Skip to content

Commit

Permalink
Fix expected number of spans
Browse files Browse the repository at this point in the history
  • Loading branch information
bouwkast committed Jul 10, 2024
1 parent d6354c7 commit 3ed79e8
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 3ed79e8

Please sign in to comment.