Skip to content

Commit 1c7b475

Browse files
committed
fix flaky tests...?
1 parent 5a18881 commit 1c7b475

File tree

3 files changed

+32
-9
lines changed

3 files changed

+32
-9
lines changed

packages/browser-integration-tests/scripts/detectFlakyTests.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import * as glob from 'glob';
22
import * as path from 'path';
33
import * as childProcess from 'child_process';
4-
import { promisify } from 'util';
54

65
async function run(): Promise<void> {
76
let testPaths: string[] = [];

packages/browser-integration-tests/suites/replay/largeMutations/defaultOptions/test.ts

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,32 @@ sentryTest(
2828
const [res0] = await Promise.all([waitForReplayRequest(page, 0), gotoPageAndClick()]);
2929
await forceFlushReplay();
3030

31-
const [res1] = await Promise.all([waitForReplayRequest(page), page.click('#button-add')]);
32-
await forceFlushReplay();
31+
const [res1] = await Promise.all([
32+
waitForReplayRequest(page, (_event, res) => {
33+
const parsed = getReplayRecordingContent(res);
34+
return !!parsed.incrementalSnapshots.length || !!parsed.fullSnapshots.length;
35+
}),
36+
page.click('#button-add'),
37+
forceFlushReplay(),
38+
]);
3339

34-
const [res2] = await Promise.all([waitForReplayRequest(page), page.click('#button-modify')]);
35-
await forceFlushReplay();
40+
const [res2] = await Promise.all([
41+
waitForReplayRequest(page, (_event, res) => {
42+
const parsed = getReplayRecordingContent(res);
43+
return !!parsed.incrementalSnapshots.length || !!parsed.fullSnapshots.length;
44+
}),
45+
page.click('#button-modify'),
46+
forceFlushReplay(),
47+
]);
3648

37-
const [res3] = await Promise.all([waitForReplayRequest(page), page.click('#button-remove')]);
38-
await forceFlushReplay();
49+
const [res3] = await Promise.all([
50+
waitForReplayRequest(page, (_event, res) => {
51+
const parsed = getReplayRecordingContent(res);
52+
return !!parsed.incrementalSnapshots.length || !!parsed.fullSnapshots.length;
53+
}),
54+
page.click('#button-remove'),
55+
forceFlushReplay(),
56+
]);
3957

4058
const replayData0 = getReplayRecordingContent(res0);
4159
const replayData1 = getReplayRecordingContent(res1);

packages/browser-integration-tests/suites/replay/largeMutations/mutationLimit/test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,14 @@ sentryTest(
3434
const [res0] = await Promise.all([waitForReplayRequest(page, 0), gotoPageAndClick()]);
3535
await forceFlushReplay();
3636

37-
const [res1] = await Promise.all([waitForReplayRequest(page), page.click('#button-add')]);
38-
await forceFlushReplay();
37+
const [res1] = await Promise.all([
38+
waitForReplayRequest(page, (_event, res) => {
39+
const parsed = getReplayRecordingContent(res);
40+
return !!parsed.incrementalSnapshots.length || !!parsed.fullSnapshots.length;
41+
}),
42+
page.click('#button-add'),
43+
forceFlushReplay(),
44+
]);
3945

4046
// replay should be stopped due to mutation limit
4147
let replay = await getReplaySnapshot(page);

0 commit comments

Comments
 (0)