@@ -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
25
+ expectedProfileTypes = DEFAULT_PROFILE_TYPES , expectBadExit = false , expectSeq = true
26
26
) {
27
27
return Promise . all ( [
28
28
processExitPromise ( proc , timeout , expectBadExit ) ,
29
- expectProfileMessagePromise ( agent , timeout , expectedProfileTypes )
29
+ expectProfileMessagePromise ( agent , timeout , expectedProfileTypes , expectSeq )
30
30
] )
31
31
}
32
32
33
33
function expectProfileMessagePromise ( agent , timeout ,
34
- expectedProfileTypes = DEFAULT_PROFILE_TYPES
34
+ expectedProfileTypes = DEFAULT_PROFILE_TYPES , expectSeq = true
35
35
) {
36
36
const fileNames = expectedProfileTypes . map ( type => `${ type } .pprof` )
37
37
return agent . assertMessageReceived ( ( { headers, _, files } ) => {
@@ -50,6 +50,9 @@ function expectProfileMessagePromise (agent, timeout,
50
50
for ( const [ index , fileName ] of attachments . entries ( ) ) {
51
51
assert . propertyVal ( files [ index + 1 ] , 'originalname' , fileName )
52
52
}
53
+ if ( expectSeq ) {
54
+ assert ( event . tags_profiler . indexOf ( ',profile_seq:' ) !== - 1 )
55
+ }
53
56
} catch ( e ) {
54
57
e . message += ` ${ JSON . stringify ( { headers, files, event } ) } `
55
58
throw e
@@ -560,7 +563,7 @@ describe('profiler', () => {
560
563
execArgv : oomExecArgv ,
561
564
env : oomEnv
562
565
} )
563
- return checkProfiles ( agent , proc , timeout , [ 'space' ] , true )
566
+ return checkProfiles ( agent , proc , timeout , [ 'space' ] , true , false )
564
567
} )
565
568
566
569
it ( 'sends a heap profile on OOM in worker thread and exits successfully' , ( ) => {
@@ -584,7 +587,7 @@ describe('profiler', () => {
584
587
DD_PROFILING_EXPERIMENTAL_OOM_MAX_HEAP_EXTENSION_COUNT : 3
585
588
}
586
589
} )
587
- return checkProfiles ( agent , proc , timeout , [ 'space' ] , false )
590
+ return checkProfiles ( agent , proc , timeout , [ 'space' ] , false , false )
588
591
} ) . retries ( 3 )
589
592
590
593
it ( 'sends a heap profile on OOM with async callback' , ( ) => {
0 commit comments