@@ -1660,6 +1660,59 @@ versions.forEach((version) => {
16601660 await runAttemptToFixTest ( { extraEnvVars : { DD_TEST_MANAGEMENT_ENABLED : '0' } } )
16611661 } )
16621662
1663+ it ( 'does not tag known attempt to fix tests as new' , async ( ) => {
1664+ receiver . setKnownTests ( {
1665+ playwright : {
1666+ 'attempt-to-fix-test.js' : [
1667+ 'attempt to fix should attempt to fix failed test' ,
1668+ 'attempt to fix should attempt to fix passed test' ,
1669+ ] ,
1670+ } ,
1671+ } )
1672+ receiver . setSettings ( {
1673+ test_management : { enabled : true , attempt_to_fix_retries : 2 } ,
1674+ early_flake_detection : {
1675+ enabled : true ,
1676+ slow_test_retries : { '5s' : 2 } ,
1677+ faulty_session_threshold : 100 ,
1678+ } ,
1679+ known_tests_enabled : true ,
1680+ } )
1681+
1682+ const eventsPromise = receiver
1683+ . gatherPayloadsMaxTimeout ( ( { url } ) => url === '/api/v2/citestcycle' , ( payloads ) => {
1684+ const events = payloads . flatMap ( ( { payload } ) => payload . events )
1685+ const tests = events . filter ( event => event . type === 'test' ) . map ( event => event . content )
1686+ const atfTests = tests . filter (
1687+ t => t . meta [ TEST_MANAGEMENT_IS_ATTEMPT_TO_FIX ] === 'true'
1688+ )
1689+ assert . ok ( atfTests . length > 0 )
1690+ for ( const test of atfTests ) {
1691+ assert . ok (
1692+ ! ( TEST_IS_NEW in test . meta ) ,
1693+ 'ATF test that is in known tests should not be tagged as new'
1694+ )
1695+ }
1696+ } )
1697+
1698+ childProcess = exec (
1699+ './node_modules/.bin/playwright test -c playwright.config.js attempt-to-fix-test.js' ,
1700+ {
1701+ cwd,
1702+ env : {
1703+ ...getCiVisAgentlessConfig ( receiver . port ) ,
1704+ PW_BASE_URL : `http://localhost:${ webAppPort } ` ,
1705+ TEST_DIR : './ci-visibility/playwright-tests-test-management' ,
1706+ } ,
1707+ }
1708+ )
1709+
1710+ await Promise . all ( [
1711+ once ( childProcess , 'exit' ) ,
1712+ eventsPromise ,
1713+ ] )
1714+ } )
1715+
16631716 it ( 'does not fail retry if a test is quarantined' , async ( ) => {
16641717 receiver . setSettings ( {
16651718 test_management : { enabled : true , attempt_to_fix_retries : ATTEMPT_TO_FIX_NUM_RETRIES } ,
0 commit comments