@@ -518,7 +518,7 @@ describe('jest CommonJS', () => {
518518 const retriedTests = tests . filter ( test => test . meta [ TEST_IS_RETRY ] === 'true' )
519519
520520 assert . equal ( retriedTests . length , 2 )
521- const [ retriedTest ] = retriedTests
521+ const retriedTest = retriedTests . find ( test => test . meta [ TEST_SUITE ] . includes ( 'test-hit-breakpoint.js' ) )
522522
523523 assert . propertyVal ( retriedTest . meta , DI_ERROR_DEBUG_INFO_CAPTURED , 'true' )
524524
@@ -560,6 +560,7 @@ describe('jest CommonJS', () => {
560560 ...getCiVisAgentlessConfig ( receiver . port ) ,
561561 TESTS_TO_RUN : 'dynamic-instrumentation/test-' ,
562562 DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED : 'true' ,
563+ DD_CIVISIBILITY_FLAKY_RETRY_COUNT : '1' ,
563564 RUN_IN_PARALLEL : true
564565 } ,
565566 stdio : 'inherit'
@@ -2518,7 +2519,8 @@ describe('jest CommonJS', () => {
25182519 cwd,
25192520 env : {
25202521 ...getCiVisAgentlessConfig ( receiver . port ) ,
2521- TESTS_TO_RUN : 'dynamic-instrumentation/test-hit-breakpoint'
2522+ TESTS_TO_RUN : 'dynamic-instrumentation/test-hit-breakpoint' ,
2523+ DD_CIVISIBILITY_FLAKY_RETRY_COUNT : '1'
25222524 } ,
25232525 stdio : 'inherit'
25242526 }
@@ -2565,7 +2567,8 @@ describe('jest CommonJS', () => {
25652567 env : {
25662568 ...getCiVisAgentlessConfig ( receiver . port ) ,
25672569 TESTS_TO_RUN : 'dynamic-instrumentation/test-hit-breakpoint' ,
2568- DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED : 'true'
2570+ DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED : 'true' ,
2571+ DD_CIVISIBILITY_FLAKY_RETRY_COUNT : '1'
25692572 } ,
25702573 stdio : 'inherit'
25712574 }
@@ -2649,7 +2652,8 @@ describe('jest CommonJS', () => {
26492652 env : {
26502653 ...getCiVisAgentlessConfig ( receiver . port ) ,
26512654 TESTS_TO_RUN : 'dynamic-instrumentation/test-hit-breakpoint' ,
2652- DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED : 'true'
2655+ DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED : 'true' ,
2656+ DD_CIVISIBILITY_FLAKY_RETRY_COUNT : '1'
26532657 } ,
26542658 stdio : 'inherit'
26552659 }
@@ -2698,7 +2702,8 @@ describe('jest CommonJS', () => {
26982702 env : {
26992703 ...getCiVisAgentlessConfig ( receiver . port ) ,
27002704 TESTS_TO_RUN : 'dynamic-instrumentation/test-not-hit-breakpoint' ,
2701- DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED : 'true'
2705+ DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED : 'true' ,
2706+ DD_CIVISIBILITY_FLAKY_RETRY_COUNT : '1'
27022707 } ,
27032708 stdio : 'inherit'
27042709 }
@@ -2711,6 +2716,44 @@ describe('jest CommonJS', () => {
27112716 } ) . catch ( done )
27122717 } )
27132718 } )
2719+
2720+ it ( 'does not wait for breakpoint for a passed test' , ( done ) => {
2721+ receiver . setSettings ( {
2722+ flaky_test_retries_enabled : true ,
2723+ di_enabled : true
2724+ } )
2725+
2726+ const eventsPromise = receiver
2727+ . gatherPayloadsMaxTimeout ( ( { url } ) => url . endsWith ( '/api/v2/citestcycle' ) , ( payloads ) => {
2728+ const events = payloads . flatMap ( ( { payload } ) => payload . events )
2729+
2730+ const tests = events . filter ( event => event . type === 'test' ) . map ( event => event . content )
2731+ const retriedTests = tests . filter ( test => test . meta [ TEST_IS_RETRY ] === 'true' )
2732+
2733+ assert . equal ( retriedTests . length , 1 )
2734+ const [ retriedTest ] = retriedTests
2735+ // Duration is in nanoseconds, so 200 * 1e6 is 200ms
2736+ assert . equal ( retriedTest . duration < 200 * 1e6 , true )
2737+ } )
2738+
2739+ childProcess = exec ( runTestsWithCoverageCommand ,
2740+ {
2741+ cwd,
2742+ env : {
2743+ ...getCiVisAgentlessConfig ( receiver . port ) ,
2744+ TESTS_TO_RUN : 'dynamic-instrumentation/test-hit-breakpoint' ,
2745+ DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED : 'true' ,
2746+ DD_CIVISIBILITY_FLAKY_RETRY_COUNT : '1' ,
2747+ TEST_SHOULD_PASS_AFTER_RETRY : '1'
2748+ } ,
2749+ stdio : 'inherit'
2750+ }
2751+ )
2752+
2753+ childProcess . on ( 'exit' , ( ) => {
2754+ eventsPromise . then ( ( ) => done ( ) ) . catch ( done )
2755+ } )
2756+ } )
27142757 } )
27152758
27162759 // This happens when using office-addin-mock
0 commit comments