Skip to content

Commit

Permalink
fix skipped Test: TraceProviderSdkTest.TracerProviderSdkInvokesSampli…
Browse files Browse the repository at this point in the history
…ngWithCorrectParameters (#2809)
  • Loading branch information
TimothyMothra committed Jan 26, 2022
1 parent 2eb46a8 commit d56f925
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions test/OpenTelemetry.Tests/Trace/TracerProviderSdkTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public TracerProviderSdkTest()
Activity.DefaultIdFormat = ActivityIdFormat.W3C;
}

[Fact(Skip = "Get around GitHub failure")]
[Fact]
public void TracerProviderSdkInvokesSamplingWithCorrectParameters()
{
var testSampler = new TestSampler();
Expand Down Expand Up @@ -101,10 +101,15 @@ public void TracerProviderSdkInvokesSamplingWithCorrectParameters()
using (var fromInvalidW3CIdParent =
activitySource.StartActivity("customContext", ActivityKind.Client, "InvalidW3CIdParent"))
{
// OpenTelemetry ActivityContext does not support
// non W3C Ids. Starting activity with non W3C Ids
// will result in no activity being created.
Assert.Null(fromInvalidW3CIdParent);
// Verify that StartActivity returns an instance of Activity.
Assert.NotNull(fromInvalidW3CIdParent);

// Verify that the TestSampler was invoked and received the correct params.
Assert.Equal(fromInvalidW3CIdParent.TraceId, testSampler.LatestSamplingParameters.TraceId);

// OpenTelemetry ActivityContext does not support non W3C Ids.
Assert.Null(fromInvalidW3CIdParent.ParentId);
Assert.Equal(default(ActivitySpanId), fromInvalidW3CIdParent.ParentSpanId);
}
}

Expand Down

0 comments on commit d56f925

Please sign in to comment.