@@ -2365,6 +2365,68 @@ describe('jest CommonJS', () => {
23652365 } ) . catch ( done )
23662366 } )
23672367 } )
2368+
2369+ it ( 'does not retry when it.failing is used' , ( done ) => {
2370+ receiver . setInfoResponse ( { endpoints : [ '/evp_proxy/v4' ] } )
2371+ const NUM_RETRIES_EFD = 3
2372+ receiver . setSettings ( {
2373+ early_flake_detection : {
2374+ enabled : true ,
2375+ slow_test_retries : {
2376+ '5s' : NUM_RETRIES_EFD
2377+ } ,
2378+ faulty_session_threshold : 100
2379+ } ,
2380+ known_tests_enabled : true
2381+ } )
2382+ const eventsPromise = receiver
2383+ . gatherPayloadsMaxTimeout ( ( { url } ) => url . endsWith ( '/api/v2/citestcycle' ) , ( payloads ) => {
2384+ const events = payloads . flatMap ( ( { payload } ) => payload . events )
2385+
2386+ const testSession = events . find ( event => event . type === 'test_session_end' ) . content
2387+ assert . propertyVal ( testSession . meta , TEST_EARLY_FLAKE_ENABLED , 'true' )
2388+
2389+ const tests = events . filter ( event => event . type === 'test' ) . map ( event => event . content )
2390+
2391+ const newTests = tests . filter ( test =>
2392+ test . meta [ TEST_SUITE ] === 'ci-visibility/jest/failing-test.js'
2393+ )
2394+ newTests . forEach ( test => {
2395+ assert . notProperty ( test . meta , TEST_IS_NEW )
2396+ } )
2397+ assert . equal ( newTests . length , 2 )
2398+
2399+ const passingTests = tests . filter ( test =>
2400+ test . meta [ TEST_NAME ] === 'failing can report failed tests'
2401+ )
2402+ const failingTests = tests . filter ( test =>
2403+ test . meta [ TEST_NAME ] === 'failing can report failing tests as failures'
2404+ )
2405+ passingTests . forEach ( test => {
2406+ assert . equal ( test . meta [ TEST_STATUS ] , 'pass' )
2407+ } )
2408+ failingTests . forEach ( test => {
2409+ assert . equal ( test . meta [ TEST_STATUS ] , 'fail' )
2410+ } )
2411+
2412+ const retriedTests = newTests . filter ( test => test . meta [ TEST_IS_RETRY ] === 'true' )
2413+ assert . equal ( retriedTests . length , 0 )
2414+ } )
2415+
2416+ childProcess = exec (
2417+ runTestsWithCoverageCommand ,
2418+ {
2419+ cwd,
2420+ env : { ...getCiVisEvpProxyConfig ( receiver . port ) , TESTS_TO_RUN : 'jest/failing-test' } ,
2421+ stdio : 'inherit'
2422+ }
2423+ )
2424+ childProcess . on ( 'exit' , ( ) => {
2425+ eventsPromise . then ( ( ) => {
2426+ done ( )
2427+ } ) . catch ( done )
2428+ } )
2429+ } )
23682430 } )
23692431
23702432 context ( 'flaky test retries' , ( ) => {
0 commit comments