Skip to content

Commit 5b5a66b

Browse files
SVLS-8232: Properly test cold_start attribute in LMI
1 parent 2be85c6 commit 5b5a66b

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

integration-tests/tests/lmi.test.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,23 @@ 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+
// Only check cold_start attribute when no dedicated cold_start span exists
84+
if (!coldStartSpan) {
85+
expect(awsLambdaSpan?.attributes.custom.cold_start).toBe('false');
86+
}
7687
})
7788

7889
});

0 commit comments

Comments
 (0)