web: make real-time sync test more reliable

This commit is contained in:
Abdullah Atta
2022-11-23 16:21:56 +05:00
parent 77c9db0faa
commit c5fcc7e962

View File

@@ -39,9 +39,10 @@ async function actAndSync<T>(
) {
const results = await Promise.all([
...actions.filter((a) => !!a),
...devices.map((d) => d.waitForSync("synced", "now")),
...devices.map((d) => d.page.waitForTimeout(1000))
...devices.map((d) => d.waitForSync("synced", "now"))
]);
await Promise.all(devices.map((d) => d.page.waitForTimeout(2000)));
return results.slice(0, actions.length) as T[];
}