From 3ed79e8d7b3b1607da0d6a4283ade943dfc8e0bd Mon Sep 17 00:00:00 2001 From: Steven Bouwkamp Date: Wed, 3 Jul 2024 12:03:36 -0400 Subject: [PATCH] Fix expected number of spans --- .../OpenTelemetrySdkTests.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/OpenTelemetrySdkTests.cs b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/OpenTelemetrySdkTests.cs index 91b40a7f368e..06633032198c 100644 --- a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/OpenTelemetrySdkTests.cs +++ b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/OpenTelemetrySdkTests.cs @@ -109,7 +109,7 @@ public async Task SubmitsTraces(string packageVersion, bool legacyOperationNames using (var agent = EnvironmentHelper.GetMockAgent()) using (await RunSampleAndWaitForExit(agent, packageVersion: packageVersion)) { - const int expectedSpanCount = 36; + const int expectedSpanCount = 37; var spans = agent.WaitForSpans(expectedSpanCount); using var s = new AssertionScope(); @@ -118,8 +118,8 @@ public async Task SubmitsTraces(string packageVersion, bool legacyOperationNames var otelSpans = spans.Where(s => s.Service == "MyServiceName"); var activitySourceSpans = spans.Where(s => s.Service == CustomServiceName); - otelSpans.Count().Should().Be(expectedSpanCount - 2); // there is another span w/ service == ServiceNameOverride - activitySourceSpans.Count().Should().Be(1); + otelSpans.Count().Should().Be(expectedSpanCount - 3); // there is another span w/ service == ServiceNameOverride + activitySourceSpans.Count().Should().Be(2); ValidateIntegrationSpans(otelSpans, metadataSchemaVersion: "v0", expectedServiceName: "MyServiceName", isExternalSpan: false); ValidateIntegrationSpans(activitySourceSpans, metadataSchemaVersion: "v0", expectedServiceName: CustomServiceName, isExternalSpan: false); @@ -159,13 +159,13 @@ public async Task SubmitsTracesWithActivitySource(string packageVersion) using (var agent = EnvironmentHelper.GetMockAgent()) using (await RunSampleAndWaitForExit(agent, packageVersion: packageVersion)) { - const int expectedSpanCount = 36; + const int expectedSpanCount = 37; var spans = agent.WaitForSpans(expectedSpanCount); using var s = new AssertionScope(); var otelSpans = spans.Where(s => s.Service == "MyServiceName"); - otelSpans.Count().Should().Be(expectedSpanCount - 1); // there is another span w/ service == ServiceNameOverride + otelSpans.Count().Should().Be(expectedSpanCount - 2); // there is another span w/ service == ServiceNameOverride ValidateIntegrationSpans(otelSpans, metadataSchemaVersion: "v0", expectedServiceName: "MyServiceName", isExternalSpan: false);