@@ -18,7 +18,7 @@ const SESSION_MAX_AGE = 4000;
18
18
The main difference between this and sessionExpiry test, is that here we wait for the overall time (4s)
19
19
in multiple steps (2s, 2s) instead of waiting for the whole time at once (4s).
20
20
*/
21
- sentryTest ( 'handles session that exceeds max age' , async ( { getLocalTestPath, page } ) => {
21
+ sentryTest ( 'handles session that exceeds max age' , async ( { forceFlushReplay , getLocalTestPath, page } ) => {
22
22
if ( shouldSkipReplayTest ( ) ) {
23
23
sentryTest . skip ( ) ;
24
24
}
@@ -60,6 +60,7 @@ sentryTest('handles session that exceeds max age', async ({ getLocalTestPath, pa
60
60
const timePassed1 = Date . now ( ) - startTimestamp ;
61
61
await new Promise ( resolve => setTimeout ( resolve , Math . max ( SESSION_MAX_AGE / 2 - timePassed1 , 0 ) ) ) ;
62
62
await page . click ( '#button1' ) ;
63
+ await forceFlushReplay ( ) ;
63
64
64
65
const req1 = await reqPromise1 ;
65
66
const replayEvent1 = getReplayEvent ( req1 ) ;
@@ -73,6 +74,7 @@ sentryTest('handles session that exceeds max age', async ({ getLocalTestPath, pa
73
74
const timePassed2 = Date . now ( ) - startTimestamp ;
74
75
await new Promise ( resolve => setTimeout ( resolve , Math . max ( SESSION_MAX_AGE - timePassed2 , 0 ) ) ) ;
75
76
await page . click ( '#button2' ) ;
77
+ await forceFlushReplay ( ) ;
76
78
77
79
const req2 = await reqPromise2 ;
78
80
const replay2 = await getReplaySnapshot ( page ) ;
0 commit comments