Skip to content

Commit d56f925

Browse files
author
Timothy Mothra
authored
fix skipped Test: TraceProviderSdkTest.TracerProviderSdkInvokesSamplingWithCorrectParameters (#2809)
1 parent 2eb46a8 commit d56f925

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

test/OpenTelemetry.Tests/Trace/TracerProviderSdkTest.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public TracerProviderSdkTest()
3434
Activity.DefaultIdFormat = ActivityIdFormat.W3C;
3535
}
3636

37-
[Fact(Skip = "Get around GitHub failure")]
37+
[Fact]
3838
public void TracerProviderSdkInvokesSamplingWithCorrectParameters()
3939
{
4040
var testSampler = new TestSampler();
@@ -101,10 +101,15 @@ public void TracerProviderSdkInvokesSamplingWithCorrectParameters()
101101
using (var fromInvalidW3CIdParent =
102102
activitySource.StartActivity("customContext", ActivityKind.Client, "InvalidW3CIdParent"))
103103
{
104-
// OpenTelemetry ActivityContext does not support
105-
// non W3C Ids. Starting activity with non W3C Ids
106-
// will result in no activity being created.
107-
Assert.Null(fromInvalidW3CIdParent);
104+
// Verify that StartActivity returns an instance of Activity.
105+
Assert.NotNull(fromInvalidW3CIdParent);
106+
107+
// Verify that the TestSampler was invoked and received the correct params.
108+
Assert.Equal(fromInvalidW3CIdParent.TraceId, testSampler.LatestSamplingParameters.TraceId);
109+
110+
// OpenTelemetry ActivityContext does not support non W3C Ids.
111+
Assert.Null(fromInvalidW3CIdParent.ParentId);
112+
Assert.Equal(default(ActivitySpanId), fromInvalidW3CIdParent.ParentSpanId);
108113
}
109114
}
110115

0 commit comments

Comments
 (0)