@@ -97,7 +97,7 @@ describe(`cucumber@${version} commonJS`, () => {
9797
9898 let cwd , receiver , childProcess , testOutput
9999
100- useSandbox ( [ `@cucumber/cucumber@${ version } ` , 'assert' , 'nyc' ] , true )
100+ useSandbox ( [ `@cucumber/cucumber@${ version } ` , 'assert' , 'nyc' , 'sinon' ] , true )
101101
102102 before ( function ( ) {
103103 cwd = sandboxCwd ( )
@@ -2160,6 +2160,36 @@ describe(`cucumber@${version} commonJS`, () => {
21602160 } )
21612161 } )
21622162
2163+ onlyLatestIt ( 'does not hang when tests use fake timers and Failed Test Replay is enabled' , async ( ) => {
2164+ receiver . setSettings ( {
2165+ flaky_test_retries_enabled : true ,
2166+ di_enabled : true ,
2167+ } )
2168+
2169+ const eventsPromise = receiver
2170+ . gatherPayloadsMaxTimeout ( ( { url } ) => url . endsWith ( '/api/v2/citestcycle' ) , ( payloads ) => {
2171+ const events = payloads . flatMap ( ( { payload } ) => payload . events )
2172+ const tests = events . filter ( event => event . type === 'test' ) . map ( event => event . content )
2173+ assert . strictEqual ( tests . length , 2 )
2174+ const retriedTests = tests . filter (
2175+ t => t . meta [ TEST_RETRY_REASON ] === TEST_RETRY_REASON_TYPES . atr
2176+ )
2177+ assert . strictEqual ( retriedTests . length , 1 )
2178+ } )
2179+
2180+ const featurePath = 'ci-visibility/features-di-fake-timers/test-hit-breakpoint.feature'
2181+ childProcess = exec (
2182+ `./node_modules/.bin/cucumber-js ${ featurePath } --retry 1` ,
2183+ {
2184+ cwd,
2185+ env : envVars ,
2186+ }
2187+ )
2188+
2189+ const [ [ exitCode ] ] = await Promise . all ( [ once ( childProcess , 'exit' ) , eventsPromise ] )
2190+ assert . strictEqual ( exitCode , 1 )
2191+ } )
2192+
21632193 onlyLatestIt ( 'does not crash if the retry does not hit the breakpoint' , ( done ) => {
21642194 receiver . setSettings ( {
21652195 flaky_test_retries_enabled : true ,
0 commit comments