@@ -22,16 +22,16 @@ if (process.platform !== 'win32') {
22
22
const TIMEOUT = 30000
23
23
24
24
function checkProfiles ( agent , proc , timeout ,
25
- expectedProfileTypes = DEFAULT_PROFILE_TYPES , expectBadExit = false , multiplicity = 1
25
+ expectedProfileTypes = DEFAULT_PROFILE_TYPES , expectBadExit = false
26
26
) {
27
27
return Promise . all ( [
28
28
processExitPromise ( proc , timeout , expectBadExit ) ,
29
- expectProfileMessagePromise ( agent , timeout , expectedProfileTypes , multiplicity )
29
+ expectProfileMessagePromise ( agent , timeout , expectedProfileTypes )
30
30
] )
31
31
}
32
32
33
33
function expectProfileMessagePromise ( agent , timeout ,
34
- expectedProfileTypes = DEFAULT_PROFILE_TYPES , multiplicity = 1
34
+ expectedProfileTypes = DEFAULT_PROFILE_TYPES
35
35
) {
36
36
const fileNames = expectedProfileTypes . map ( type => `${ type } .pprof` )
37
37
return agent . assertMessageReceived ( ( { headers, _, files } ) => {
@@ -54,7 +54,7 @@ function expectProfileMessagePromise (agent, timeout,
54
54
e . message += ` ${ JSON . stringify ( { headers, files, event } ) } `
55
55
throw e
56
56
}
57
- } , timeout , multiplicity )
57
+ } , timeout , 1 , true )
58
58
}
59
59
60
60
function processExitPromise ( proc , timeout , expectBadExit = false ) {
@@ -608,7 +608,7 @@ describe('profiler', () => {
608
608
cwd,
609
609
env : { ...oomEnv , DD_PROFILING_WALLTIME_ENABLED : 0 }
610
610
} )
611
- return checkProfiles ( agent , proc , timeout , [ 'space' ] , false , 2 )
611
+ return checkProfiles ( agent , proc , timeout , [ 'space' ] , false )
612
612
} )
613
613
614
614
// Following tests are flaky because they use unreliable strategies to export profiles
@@ -624,7 +624,7 @@ describe('profiler', () => {
624
624
DD_PROFILING_EXPERIMENTAL_OOM_MAX_HEAP_EXTENSION_COUNT : 3
625
625
}
626
626
} )
627
- return checkProfiles ( agent , proc , timeout , [ 'space' ] , false , 2 )
627
+ return checkProfiles ( agent , proc , timeout , [ 'space' ] , false )
628
628
} ) . retries ( 3 )
629
629
630
630
it ( 'sends a heap profile on OOM with async callback' , ( ) => {
@@ -652,7 +652,7 @@ describe('profiler', () => {
652
652
DD_PROFILING_EXPERIMENTAL_OOM_EXPORT_STRATEGIES : 'async,process'
653
653
}
654
654
} )
655
- return checkProfiles ( agent , proc , timeout , [ 'space' ] , true , 2 )
655
+ return checkProfiles ( agent , proc , timeout , [ 'space' ] , true )
656
656
} ) . retries ( 3 )
657
657
}
658
658
} )
@@ -779,10 +779,7 @@ describe('profiler', () => {
779
779
forkSsi ( [ 'create-span' , 'long-lived' ] , whichEnv ) ,
780
780
timeout ,
781
781
DEFAULT_PROFILE_TYPES ,
782
- false ,
783
- // Will receive 2 messages: first one is for the trace, second one is for the profile. We
784
- // only need the assertions in checkProfiles to succeed for the one with the profile.
785
- 2 )
782
+ false )
786
783
}
787
784
788
785
function heuristicsDoesNotTriggerFor ( args , allowTraceMessage , whichEnv ) {
0 commit comments