@@ -8,7 +8,6 @@ import { getReplayEvent, shouldSkipReplayTest, waitForReplayRequest } from '../.
8
8
const FLUSH_DELAY_SECONDS = 0.5 ;
9
9
10
10
for ( let index = 0 ; index < 25 ; index ++ ) {
11
- console . log ( 'test' , index ) ;
12
11
sentryTest ( `replay recording flushes every FLUSH_DELAY_SECONDS (${ index } )}` , async ( { getLocalTestPath, page } ) => {
13
12
if ( shouldSkipReplayTest ( ) ) {
14
13
sentryTest . skip ( ) ;
@@ -48,7 +47,7 @@ for (let index = 0; index < 25; index++) {
48
47
} catch {
49
48
// ignore errors here, we don't care if the page is closed
50
49
}
51
- } , i * 100 ) ;
50
+ } , i * 150 ) ;
52
51
}
53
52
54
53
const replayEvent2 = getReplayEvent ( await reqPromise2 ) ;
@@ -60,10 +59,10 @@ for (let index = 0; index < 25; index++) {
60
59
const diff1 = replayEvent1 . timestamp ! - replayEvent0 . timestamp ! ;
61
60
const diff2 = replayEvent2 . timestamp ! - replayEvent1 . timestamp ! ;
62
61
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 ) ;
68
67
} ) ;
69
68
}
0 commit comments