Skip to content

Commit b0c9c92

Browse files
Fix W3C tests
React to breaking change in .NET 10.
1 parent c05da3a commit b0c9c92

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/W3CTraceContextTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ public sealed class W3CTraceContextTests : IDisposable
2424
private readonly HttpClient httpClient = new();
2525
private readonly ITestOutputHelper output;
2626

27+
static W3CTraceContextTests()
28+
{
29+
// See https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/10.0/default-trace-context-propagator
30+
DistributedContextPropagator.Current = DistributedContextPropagator.CreatePreW3CPropagator();
31+
}
32+
2733
public W3CTraceContextTests(ITestOutputHelper output)
2834
{
2935
this.output = output;

0 commit comments

Comments
 (0)