Skip to content

Commit 896f1bb

Browse files
committed
loosen time margin and ease up click events
1 parent 0c16c1e commit 896f1bb

File tree

1 file changed

+6
-7
lines changed
  • packages/integration-tests/suites/replay/flushing

1 file changed

+6
-7
lines changed

packages/integration-tests/suites/replay/flushing/test.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { getReplayEvent, shouldSkipReplayTest, waitForReplayRequest } from '../.
88
const FLUSH_DELAY_SECONDS = 0.5;
99

1010
for (let index = 0; index < 25; index++) {
11-
console.log('test', index);
1211
sentryTest(`replay recording flushes every FLUSH_DELAY_SECONDS (${index})}`, async ({ getLocalTestPath, page }) => {
1312
if (shouldSkipReplayTest()) {
1413
sentryTest.skip();
@@ -48,7 +47,7 @@ for (let index = 0; index < 25; index++) {
4847
} catch {
4948
// ignore errors here, we don't care if the page is closed
5049
}
51-
}, i * 100);
50+
}, i * 150);
5251
}
5352

5453
const replayEvent2 = getReplayEvent(await reqPromise2);
@@ -60,10 +59,10 @@ for (let index = 0; index < 25; index++) {
6059
const diff1 = replayEvent1.timestamp! - replayEvent0.timestamp!;
6160
const diff2 = replayEvent2.timestamp! - replayEvent1.timestamp!;
6261

63-
// We want to check that the diff is between 0.1 and 0.9 seconds, to accomodate for some wiggle room
64-
expect(diff1).toBeLessThan(FLUSH_DELAY_SECONDS + 0.4);
65-
expect(diff1).toBeGreaterThanOrEqual(FLUSH_DELAY_SECONDS - 0.4);
66-
expect(diff2).toBeLessThan(FLUSH_DELAY_SECONDS + 0.4);
67-
expect(diff2).toBeGreaterThanOrEqual(FLUSH_DELAY_SECONDS - 0.4);
62+
// We want to check that the diff is between 0.05 and 0.95 seconds, to accomodate for some wiggle room
63+
expect(diff1).toBeLessThan(FLUSH_DELAY_SECONDS + 0.45);
64+
expect(diff1).toBeGreaterThanOrEqual(FLUSH_DELAY_SECONDS - 0.45);
65+
expect(diff2).toBeLessThan(FLUSH_DELAY_SECONDS + 0.45);
66+
expect(diff2).toBeGreaterThanOrEqual(FLUSH_DELAY_SECONDS - 0.45);
6867
});
6968
}

0 commit comments

Comments
 (0)