@@ -18,7 +18,7 @@ const SESSION_MAX_AGE = 4000;
1818 The main difference between this and sessionExpiry test, is that here we wait for the overall time (4s)
1919 in multiple steps (2s, 2s) instead of waiting for the whole time at once (4s).
2020*/
21- sentryTest ( 'handles session that exceeds max age' , async ( { getLocalTestPath, page } ) => {
21+ sentryTest ( 'handles session that exceeds max age' , async ( { forceFlushReplay , getLocalTestPath, page } ) => {
2222 if ( shouldSkipReplayTest ( ) ) {
2323 sentryTest . skip ( ) ;
2424 }
@@ -60,6 +60,7 @@ sentryTest('handles session that exceeds max age', async ({ getLocalTestPath, pa
6060 const timePassed1 = Date . now ( ) - startTimestamp ;
6161 await new Promise ( resolve => setTimeout ( resolve , Math . max ( SESSION_MAX_AGE / 2 - timePassed1 , 0 ) ) ) ;
6262 await page . click ( '#button1' ) ;
63+ await forceFlushReplay ( ) ;
6364
6465 const req1 = await reqPromise1 ;
6566 const replayEvent1 = getReplayEvent ( req1 ) ;
@@ -73,6 +74,7 @@ sentryTest('handles session that exceeds max age', async ({ getLocalTestPath, pa
7374 const timePassed2 = Date . now ( ) - startTimestamp ;
7475 await new Promise ( resolve => setTimeout ( resolve , Math . max ( SESSION_MAX_AGE - timePassed2 , 0 ) ) ) ;
7576 await page . click ( '#button2' ) ;
77+ await forceFlushReplay ( ) ;
7678
7779 const req2 = await reqPromise2 ;
7880 const replay2 = await getReplaySnapshot ( page ) ;
0 commit comments