File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,12 +67,22 @@ describe('LMI Integration Tests', () => {
6767 expect ( awsLambdaSpan ?. attributes . custom . init_type ) . toBe ( 'lambda-managed-instances' )
6868 } )
6969 // SVLS-8232
70- test . skip ( 'aws.lambda.span should have cold_start set to false' , ( ) => {
70+ it ( 'aws.lambda.span should have cold_start set to false if no cold_start operation ' , ( ) => {
7171 const trace = results [ runtime ] . traces ! [ 0 ] ;
72+
73+ // The presence of 'aws.lambda.cold_start' span indicates a cold start
74+ const coldStartSpan = trace . spans . find ( ( span : any ) =>
75+ span . attributes . operation_name === 'aws.lambda.cold_start'
76+ ) ;
77+
7278 const awsLambdaSpan = trace . spans . find ( ( span : any ) =>
7379 span . attributes . operation_name === 'aws.lambda'
7480 ) ;
75- expect ( awsLambdaSpan ?. attributes . custom . cold_start ) . toBe ( 'false' )
81+ expect ( awsLambdaSpan ) . toBeDefined ( ) ; // Ensure span exists before checking attributes
82+
83+ // cold_start attribute should be 'true' if cold_start span exists, 'false' otherwise
84+ const expectedColdStart = coldStartSpan ? 'true' : 'false' ;
85+ expect ( awsLambdaSpan ?. attributes . custom . cold_start ) . toBe ( expectedColdStart ) ;
7686 } )
7787
7888 } ) ;
You can’t perform that action at this time.
0 commit comments