From aee752765760663ace6d2dc5d7b483ee755a2672 Mon Sep 17 00:00:00 2001 From: Tianning Li Date: Mon, 12 Jan 2026 10:17:56 -0500 Subject: [PATCH] SVLS-8232: - corrected the test assumption regarding the span length - minor test case refactory. --- integration-tests/tests/lmi.test.ts | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/integration-tests/tests/lmi.test.ts b/integration-tests/tests/lmi.test.ts index e69d81921..c6d080dec 100644 --- a/integration-tests/tests/lmi.test.ts +++ b/integration-tests/tests/lmi.test.ts @@ -46,21 +46,18 @@ describe('LMI Integration Tests', () => { expect(results[runtime].traces?.length).toEqual(1); }); - // SVLS-8232 - test.skip('trace should have exactly one span', () => { + + it('trace should have exactly one span with operation_name=aws.lambda', () => { const trace = results[runtime].traces![0]; - const awsLambdaSpan = trace.spans.find((span: any) => - span.attributes.operation_name === 'aws.lambda' - ); expect(trace.spans).toBeDefined(); - expect(trace.spans.length).toEqual(1); - }); - it('trace should have aws.lambda span', () => { - const trace = results[runtime].traces![0]; - const awsLambdaSpan = trace.spans.find((span: any) => + + // Filter spans with operation_name='aws.lambda' + const awsLambdaSpans = trace.spans.filter((span: any) => span.attributes.operation_name === 'aws.lambda' ); - expect(awsLambdaSpan).toBeDefined(); + expect(awsLambdaSpans).toBeDefined(); + // Verify exactly one span has operation_name='aws.lambda' + expect(awsLambdaSpans.length).toEqual(1); }); it('aws.lambda.span should have init_type set to lambda-managed-instances', () => { const trace = results[runtime].traces![0];