diff --git a/Directory.Packages.props b/Directory.Packages.props
index f95650541a5..af1039e95ef 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -67,32 +67,32 @@
This section covers packages that are **not** directly referenced by the NuGet packages published from this repository.
For example, these packages are used in the tests, examples or referenced as "PrivateAssets", but not in the NuGet packages themselves.
-->
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
+
+
+
+
+
diff --git a/OpenTelemetry.sln b/OpenTelemetry.sln
index b7c4e130759..78fbafb7463 100644
--- a/OpenTelemetry.sln
+++ b/OpenTelemetry.sln
@@ -34,6 +34,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{7CB2F02E
build\docfx.cmd = build\docfx.cmd
build\docker-compose.net6.0.yml = build\docker-compose.net6.0.yml
build\docker-compose.net7.0.yml = build\docker-compose.net7.0.yml
+ build\docker-compose.net8.0.yml = build\docker-compose.net8.0.yml
build\finalize-publicapi.ps1 = build\finalize-publicapi.ps1
build\GlobalAttrExclusions.txt = build\GlobalAttrExclusions.txt
build\opentelemetry-icon-color.png = build\opentelemetry-icon-color.png
@@ -268,8 +269,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{A49299
src\Shared\PeerServiceResolver.cs = src\Shared\PeerServiceResolver.cs
src\Shared\PeriodicExportingMetricReaderHelper.cs = src\Shared\PeriodicExportingMetricReaderHelper.cs
src\Shared\PooledList.cs = src\Shared\PooledList.cs
- src\Shared\ResourceSemanticConventions.cs = src\Shared\ResourceSemanticConventions.cs
src\Shared\RequestMethodHelper.cs = src\Shared\RequestMethodHelper.cs
+ src\Shared\ResourceSemanticConventions.cs = src\Shared\ResourceSemanticConventions.cs
src\Shared\SemanticConventions.cs = src\Shared\SemanticConventions.cs
src\Shared\SpanAttributeConstants.cs = src\Shared\SpanAttributeConstants.cs
src\Shared\SpanHelper.cs = src\Shared\SpanHelper.cs
diff --git a/build/Common.nonprod.props b/build/Common.nonprod.props
index 4b4123472a6..d84e98e61e5 100644
--- a/build/Common.nonprod.props
+++ b/build/Common.nonprod.props
@@ -8,7 +8,7 @@
- net7.0
+ net8.0
diff --git a/examples/MicroserviceExample/WebApi/Dockerfile b/examples/MicroserviceExample/WebApi/Dockerfile
index adb1443b70a..d74077a0a87 100644
--- a/examples/MicroserviceExample/WebApi/Dockerfile
+++ b/examples/MicroserviceExample/WebApi/Dockerfile
@@ -1,7 +1,7 @@
-ARG SDK_VERSION=7.0
+ARG SDK_VERSION=8.0
FROM mcr.microsoft.com/dotnet/sdk:${SDK_VERSION} AS build
ARG PUBLISH_CONFIGURATION=Release
-ARG PUBLISH_FRAMEWORK=net7.0
+ARG PUBLISH_FRAMEWORK=net8.0
WORKDIR /app
COPY . ./
RUN dotnet publish ./examples/MicroserviceExample/WebApi -c "${PUBLISH_CONFIGURATION}" -f "${PUBLISH_FRAMEWORK}" -o /out -p:IntegrationBuild=true
diff --git a/examples/MicroserviceExample/WorkerService/Dockerfile b/examples/MicroserviceExample/WorkerService/Dockerfile
index 42de22a9e31..dafc0049b46 100644
--- a/examples/MicroserviceExample/WorkerService/Dockerfile
+++ b/examples/MicroserviceExample/WorkerService/Dockerfile
@@ -1,7 +1,7 @@
-ARG SDK_VERSION=7.0
+ARG SDK_VERSION=8.0
FROM mcr.microsoft.com/dotnet/sdk:${SDK_VERSION} AS build
ARG PUBLISH_CONFIGURATION=Release
-ARG PUBLISH_FRAMEWORK=net7.0
+ARG PUBLISH_FRAMEWORK=net8.0
WORKDIR /app
COPY . ./
RUN dotnet publish ./examples/MicroserviceExample/WorkerService -c "${PUBLISH_CONFIGURATION}" -f "${PUBLISH_FRAMEWORK}" -o /out -p:IntegrationBuild=true
diff --git a/test/Benchmarks/README.md b/test/Benchmarks/README.md
index b168f038dc8..db06040cae6 100644
--- a/test/Benchmarks/README.md
+++ b/test/Benchmarks/README.md
@@ -3,11 +3,11 @@
Navigate to `./test/Benchmarks` directory and run the following command:
```sh
-dotnet run -c Release -f net7.0 -- -m
+dotnet run -c Release -f net8.0 -- -m
```
[How to use console arguments](https://benchmarkdotnet.org/articles/guides/console-args.html)
- `-m` enables MemoryDiagnoser and prints memory statistics
- `-f` allows you to filter the benchmarks by their full name using glob patterns
- - `dotnet run -c Release -f net7.0 -- -f *TraceBenchmarks*`
+ - `dotnet run -c Release -f net8.0 -- -f *TraceBenchmarks*`
diff --git a/test/OpenTelemetry.Api.Tests/BaggageTests.cs b/test/OpenTelemetry.Api.Tests/BaggageTests.cs
index 02532070139..8ffcafde42c 100644
--- a/test/OpenTelemetry.Api.Tests/BaggageTests.cs
+++ b/test/OpenTelemetry.Api.Tests/BaggageTests.cs
@@ -275,7 +275,7 @@ public async Task AsyncLocalTests()
{
Baggage.SetBaggage("key1", "value1");
- await InnerTask().ConfigureAwait(false);
+ await InnerTask();
Baggage.SetBaggage("key4", "value4");
diff --git a/test/OpenTelemetry.Api.Tests/Trace/TracerTest.cs b/test/OpenTelemetry.Api.Tests/Trace/TracerTest.cs
index 1e2e1f4579b..c38cdb46ec9 100644
--- a/test/OpenTelemetry.Api.Tests/Trace/TracerTest.cs
+++ b/test/OpenTelemetry.Api.Tests/Trace/TracerTest.cs
@@ -83,16 +83,16 @@ public async Task Tracer_StartRootSpan_StartsNewTrace()
async Task DoSomeAsyncWork()
{
- await Task.Delay(10).ConfigureAwait(false);
+ await Task.Delay(10);
using (tracer.GetTracer("tracername").StartRootSpan("RootSpan2"))
{
- await Task.Delay(10).ConfigureAwait(false);
+ await Task.Delay(10);
}
}
using (tracer.GetTracer("tracername").StartActiveSpan("RootSpan1"))
{
- await DoSomeAsyncWork().ConfigureAwait(false);
+ await DoSomeAsyncWork();
}
Assert.Equal(2, exportedItems.Count);
diff --git a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/Implementation/ExportClient/OtlpHttpTraceExportClientTests.cs b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/Implementation/ExportClient/OtlpHttpTraceExportClientTests.cs
index 38e9a95ea48..240c8ad88c1 100644
--- a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/Implementation/ExportClient/OtlpHttpTraceExportClientTests.cs
+++ b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/Implementation/ExportClient/OtlpHttpTraceExportClientTests.cs
@@ -106,12 +106,12 @@ public void SendExportRequest_ExportTraceServiceRequest_SendsCorrectHttpRequest(
{
return new HttpResponseMessage();
})
- .Callback((r, ct) =>
+ .Callback(async (r, ct) =>
{
httpRequest = r;
// We have to capture content as it can't be accessed after request is disposed inside of SendExportRequest method
- httpRequestContent = r.Content.ReadAsByteArrayAsync(ct)?.Result;
+ httpRequestContent = await r.Content.ReadAsByteArrayAsync(ct);
})
#else
.Setup>("SendAsync", ItExpr.IsAny(), ItExpr.IsAny())
@@ -124,7 +124,7 @@ public void SendExportRequest_ExportTraceServiceRequest_SendsCorrectHttpRequest(
httpRequest = r;
// We have to capture content as it can't be accessed after request is disposed inside of SendExportRequest method
- httpRequestContent = await r.Content.ReadAsByteArrayAsync().ConfigureAwait(false);
+ httpRequestContent = await r.Content.ReadAsByteArrayAsync();
})
#endif
.Verifiable();
diff --git a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/MockCollectorIntegrationTests.cs b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/MockCollectorIntegrationTests.cs
index 8f5c287d10d..75e0dd0e55d 100644
--- a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/MockCollectorIntegrationTests.cs
+++ b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/MockCollectorIntegrationTests.cs
@@ -63,12 +63,12 @@ public async Task TestRecoveryAfterFailedExport()
endpoints.MapGrpcService();
});
}))
- .StartAsync().ConfigureAwait(false);
+ .StartAsync();
var httpClient = new HttpClient() { BaseAddress = new Uri("http://localhost:5050") };
var codes = new[] { Grpc.Core.StatusCode.Unimplemented, Grpc.Core.StatusCode.OK };
- await httpClient.GetAsync($"/MockCollector/SetResponseCodes/{string.Join(",", codes.Select(x => (int)x))}").ConfigureAwait(false);
+ await httpClient.GetAsync($"/MockCollector/SetResponseCodes/{string.Join(",", codes.Select(x => (int)x))}");
var exportResults = new List();
var otlpExporter = new OtlpTraceExporter(new OtlpExporterOptions() { Endpoint = new Uri("http://localhost:4317") });
@@ -101,7 +101,7 @@ public async Task TestRecoveryAfterFailedExport()
Assert.Equal(2, exportResults.Count);
Assert.Equal(ExportResult.Success, exportResults[1]);
- await host.StopAsync().ConfigureAwait(false);
+ await host.StopAsync();
}
private class MockCollectorState
diff --git a/test/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests/PrometheusExporterMiddlewareTests.cs b/test/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests/PrometheusExporterMiddlewareTests.cs
index 3de33a38cba..ea38fb59cf9 100644
--- a/test/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests/PrometheusExporterMiddlewareTests.cs
+++ b/test/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests/PrometheusExporterMiddlewareTests.cs
@@ -172,7 +172,7 @@ await RunPrometheusExporterMiddlewareIntegrationTest(
path: null,
configureBranchedPipeline: null,
optionsName: null),
- registerMeterProvider: false).ConfigureAwait(false);
+ registerMeterProvider: false);
}
[Fact]
@@ -235,7 +235,7 @@ await RunPrometheusExporterMiddlewareIntegrationTest(
configureBranchedPipeline: null,
optionsName: null)),
services => services.AddRouting(),
- registerMeterProvider: false).ConfigureAwait(false);
+ registerMeterProvider: false);
}
private static async Task RunPrometheusExporterMiddlewareIntegrationTest(
@@ -265,7 +265,7 @@ private static async Task RunPrometheusExporterMiddlewareIntegrationTest(
configureServices?.Invoke(services);
})
.Configure(configure))
- .StartAsync().ConfigureAwait(false);
+ .StartAsync();
var tags = new KeyValuePair[]
{
@@ -284,7 +284,7 @@ private static async Task RunPrometheusExporterMiddlewareIntegrationTest(
counter.Add(0.99D, tags);
}
- using var response = await host.GetTestClient().GetAsync(path).ConfigureAwait(false);
+ using var response = await host.GetTestClient().GetAsync(path);
var endTimestamp = DateTimeOffset.Now.ToUnixTimeMilliseconds();
@@ -294,7 +294,7 @@ private static async Task RunPrometheusExporterMiddlewareIntegrationTest(
Assert.True(response.Content.Headers.Contains("Last-Modified"));
Assert.Equal("text/plain; charset=utf-8; version=0.0.4", response.Content.Headers.ContentType.ToString());
- string content = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
+ string content = await response.Content.ReadAsStringAsync();
var matches = Regex.Matches(
content,
@@ -318,7 +318,7 @@ private static async Task RunPrometheusExporterMiddlewareIntegrationTest(
validateResponse?.Invoke(response);
- await host.StopAsync().ConfigureAwait(false);
+ await host.StopAsync();
}
}
#endif
diff --git a/test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/PrometheusCollectionManagerTests.cs b/test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/PrometheusCollectionManagerTests.cs
index 1b44b854d3c..70b886b5202 100644
--- a/test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/PrometheusCollectionManagerTests.cs
+++ b/test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/PrometheusCollectionManagerTests.cs
@@ -65,7 +65,7 @@ public async Task EnterExitCollectTest(int scrapeResponseCacheDurationMillisecon
{
collectTasks[i] = Task.Run(async () =>
{
- var response = await exporter.CollectionManager.EnterCollect().ConfigureAwait(false);
+ var response = await exporter.CollectionManager.EnterCollect();
try
{
return new Response
@@ -81,18 +81,18 @@ public async Task EnterExitCollectTest(int scrapeResponseCacheDurationMillisecon
});
}
- await Task.WhenAll(collectTasks).ConfigureAwait(false);
+ await Task.WhenAll(collectTasks);
Assert.Equal(1, runningCollectCount);
- var firstResponse = collectTasks[0].Result;
+ var firstResponse = await collectTasks[0];
Assert.False(firstResponse.CollectionResponse.FromCache);
for (int i = 1; i < collectTasks.Length; i++)
{
- Assert.Equal(firstResponse.ViewPayload, collectTasks[i].Result.ViewPayload);
- Assert.Equal(firstResponse.CollectionResponse.GeneratedAtUtc, collectTasks[i].Result.CollectionResponse.GeneratedAtUtc);
+ Assert.Equal(firstResponse.ViewPayload, (await collectTasks[i]).ViewPayload);
+ Assert.Equal(firstResponse.CollectionResponse.GeneratedAtUtc, (await collectTasks[i]).CollectionResponse.GeneratedAtUtc);
}
counter.Add(100);
@@ -100,7 +100,7 @@ public async Task EnterExitCollectTest(int scrapeResponseCacheDurationMillisecon
// This should use the cache and ignore the second counter update.
var task = exporter.CollectionManager.EnterCollect();
Assert.True(task.IsCompleted);
- var response = await task.ConfigureAwait(false);
+ var response = await task;
try
{
if (cacheEnabled)
@@ -129,7 +129,7 @@ public async Task EnterExitCollectTest(int scrapeResponseCacheDurationMillisecon
{
collectTasks[i] = Task.Run(async () =>
{
- var response = await exporter.CollectionManager.EnterCollect().ConfigureAwait(false);
+ var response = await exporter.CollectionManager.EnterCollect();
try
{
return new Response
@@ -145,20 +145,20 @@ public async Task EnterExitCollectTest(int scrapeResponseCacheDurationMillisecon
});
}
- await Task.WhenAll(collectTasks).ConfigureAwait(false);
+ await Task.WhenAll(collectTasks);
Assert.Equal(cacheEnabled ? 2 : 3, runningCollectCount);
- Assert.NotEqual(firstResponse.ViewPayload, collectTasks[0].Result.ViewPayload);
- Assert.NotEqual(firstResponse.CollectionResponse.GeneratedAtUtc, collectTasks[0].Result.CollectionResponse.GeneratedAtUtc);
+ Assert.NotEqual(firstResponse.ViewPayload, (await collectTasks[0]).ViewPayload);
+ Assert.NotEqual(firstResponse.CollectionResponse.GeneratedAtUtc, (await collectTasks[0]).CollectionResponse.GeneratedAtUtc);
- firstResponse = collectTasks[0].Result;
+ firstResponse = await collectTasks[0];
Assert.False(firstResponse.CollectionResponse.FromCache);
for (int i = 1; i < collectTasks.Length; i++)
{
- Assert.Equal(firstResponse.ViewPayload, collectTasks[i].Result.ViewPayload);
- Assert.Equal(firstResponse.CollectionResponse.GeneratedAtUtc, collectTasks[i].Result.CollectionResponse.GeneratedAtUtc);
+ Assert.Equal(firstResponse.ViewPayload, (await collectTasks[i]).ViewPayload);
+ Assert.Equal(firstResponse.CollectionResponse.GeneratedAtUtc, (await collectTasks[i]).CollectionResponse.GeneratedAtUtc);
}
}
}
diff --git a/test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/PrometheusHttpListenerTests.cs b/test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/PrometheusHttpListenerTests.cs
index 5ef88ad24a1..d964432009e 100644
--- a/test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/PrometheusHttpListenerTests.cs
+++ b/test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/PrometheusHttpListenerTests.cs
@@ -81,13 +81,13 @@ public void UriPrefixesInvalid()
[Fact]
public async Task PrometheusExporterHttpServerIntegration()
{
- await this.RunPrometheusExporterHttpServerIntegrationTest().ConfigureAwait(false);
+ await this.RunPrometheusExporterHttpServerIntegrationTest();
}
[Fact]
public async Task PrometheusExporterHttpServerIntegration_NoMetrics()
{
- await this.RunPrometheusExporterHttpServerIntegrationTest(skipMetrics: true).ConfigureAwait(false);
+ await this.RunPrometheusExporterHttpServerIntegrationTest(skipMetrics: true);
}
private async Task RunPrometheusExporterHttpServerIntegrationTest(bool skipMetrics = false)
@@ -125,7 +125,7 @@ private async Task RunPrometheusExporterHttpServerIntegrationTest(bool skipMetri
}
using HttpClient client = new HttpClient();
- using var response = await client.GetAsync($"{address}metrics").ConfigureAwait(false);
+ using var response = await client.GetAsync($"{address}metrics");
if (!skipMetrics)
{
@@ -135,7 +135,7 @@ private async Task RunPrometheusExporterHttpServerIntegrationTest(bool skipMetri
Assert.Matches(
"^# TYPE counter_double_total counter\ncounter_double_total{key1='value1',key2='value2'} 101.17 \\d+\n\n# EOF\n$".Replace('\'', '"'),
- await response.Content.ReadAsStringAsync().ConfigureAwait(false));
+ await response.Content.ReadAsStringAsync());
}
else
{
diff --git a/test/OpenTelemetry.Extensions.Hosting.Tests/InMemoryExporterMetricsExtensionsTests.cs b/test/OpenTelemetry.Extensions.Hosting.Tests/InMemoryExporterMetricsExtensionsTests.cs
index 0d686b895bd..1122f2f02d2 100644
--- a/test/OpenTelemetry.Extensions.Hosting.Tests/InMemoryExporterMetricsExtensionsTests.cs
+++ b/test/OpenTelemetry.Extensions.Hosting.Tests/InMemoryExporterMetricsExtensionsTests.cs
@@ -52,7 +52,7 @@ await RunMetricsTest(
using var meter = new Meter(meterName);
var counter = meter.CreateCounter("meter");
counter.Add(10);
- }).ConfigureAwait(false);
+ });
Assert.Single(exportedItems);
var metricPointsEnumerator = exportedItems[0].GetMetricPoints().GetEnumerator();
@@ -75,7 +75,7 @@ await RunMetricsTest(
using var meter = new Meter(meterName);
var counter = meter.CreateCounter("meter");
counter.Add(10);
- }).ConfigureAwait(false);
+ });
Assert.Single(exportedItems);
Assert.Equal(10, exportedItems[0].MetricPoints[0].GetSumLong());
@@ -96,13 +96,13 @@ private static async Task RunMetricsTest(Action configure,
return Task.CompletedTask;
})))
- .StartAsync().ConfigureAwait(false);
+ .StartAsync();
- using var response = await host.GetTestClient().GetAsync($"/{nameof(RunMetricsTest)}").ConfigureAwait(false);
+ using var response = await host.GetTestClient().GetAsync($"/{nameof(RunMetricsTest)}");
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- await host.StopAsync().ConfigureAwait(false);
+ await host.StopAsync();
}
}
#endif
diff --git a/test/OpenTelemetry.Extensions.Hosting.Tests/OpenTelemetryServicesExtensionsTests.cs b/test/OpenTelemetry.Extensions.Hosting.Tests/OpenTelemetryServicesExtensionsTests.cs
index 181dec9e367..2b447a816d8 100644
--- a/test/OpenTelemetry.Extensions.Hosting.Tests/OpenTelemetryServicesExtensionsTests.cs
+++ b/test/OpenTelemetry.Extensions.Hosting.Tests/OpenTelemetryServicesExtensionsTests.cs
@@ -37,9 +37,9 @@ public async Task AddOpenTelemetry_StartWithoutProvidersDoesNotThrow()
var host = builder.Build();
- await host.StartAsync().ConfigureAwait(false);
+ await host.StartAsync();
- await host.StopAsync().ConfigureAwait(false);
+ await host.StopAsync();
}
[Fact]
@@ -75,9 +75,9 @@ public async Task AddOpenTelemetry_StartWithExceptionsThrows()
var host = builder.Build();
- await Assert.ThrowsAsync(() => host.StartAsync()).ConfigureAwait(false);
+ await Assert.ThrowsAsync(() => host.StartAsync());
- await host.StopAsync().ConfigureAwait(false);
+ await host.StopAsync();
Assert.True(expectedInnerExceptionThrown);
}
@@ -172,11 +172,11 @@ public async Task AddOpenTelemetry_WithTracing_HostConfigurationHonoredTest()
Assert.False(configureBuilderCalled);
- await host.StartAsync().ConfigureAwait(false);
+ await host.StartAsync();
Assert.True(configureBuilderCalled);
- await host.StopAsync().ConfigureAwait(false);
+ await host.StopAsync();
host.Dispose();
}
@@ -295,11 +295,11 @@ public async Task AddOpenTelemetry_WithMetrics_HostConfigurationHonoredTest()
Assert.False(configureBuilderCalled);
- await host.StartAsync().ConfigureAwait(false);
+ await host.StartAsync();
Assert.True(configureBuilderCalled);
- await host.StopAsync().ConfigureAwait(false);
+ await host.StopAsync();
host.Dispose();
}
@@ -418,11 +418,11 @@ public async Task AddOpenTelemetry_WithLogging_HostConfigurationHonoredTest()
Assert.False(configureBuilderCalled);
- await host.StartAsync().ConfigureAwait(false);
+ await host.StartAsync();
Assert.True(configureBuilderCalled);
- await host.StopAsync().ConfigureAwait(false);
+ await host.StopAsync();
host.Dispose();
}
@@ -469,8 +469,8 @@ public async Task AddOpenTelemetry_HostedServiceOrder_DoesNotMatter()
});
var host = builder.Build();
- await host.StartAsync().ConfigureAwait(false);
- await host.StopAsync().ConfigureAwait(false);
+ await host.StartAsync();
+ await host.StopAsync();
host.Dispose();
Assert.Single(exportedItems);
diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs
index 93ef8753772..43794de2983 100644
--- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs
+++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs
@@ -83,7 +83,7 @@ void ConfigureTestServices(IServiceCollection services)
.CreateClient())
{
// Act
- using var response = await client.GetAsync("/api/values").ConfigureAwait(false);
+ using var response = await client.GetAsync("/api/values");
// Assert
response.EnsureSuccessStatusCode(); // Status Code 200-299
@@ -130,7 +130,7 @@ void ConfigureTestServices(IServiceCollection services)
.CreateClient())
{
// Act
- using var response = await client.GetAsync("/api/values").ConfigureAwait(false);
+ using var response = await client.GetAsync("/api/values");
// Assert
response.EnsureSuccessStatusCode(); // Status Code 200-299
@@ -177,7 +177,7 @@ public async Task SuccessfulTemplateControllerCallUsesParentContext()
request.Headers.Add("traceparent", $"00-{expectedTraceId}-{expectedSpanId}-01");
// Act
- var response = await client.SendAsync(request).ConfigureAwait(false);
+ var response = await client.SendAsync(request);
// Assert
response.EnsureSuccessStatusCode(); // Status Code 200-299
@@ -241,7 +241,7 @@ public async Task CustomPropagator(bool addSampler)
}))
{
using var client = testFactory.CreateClient();
- using var response = await client.GetAsync("/api/values/2").ConfigureAwait(false);
+ using var response = await client.GetAsync("/api/values/2");
response.EnsureSuccessStatusCode(); // Status Code 200-299
WaitForActivityExport(exportedItems, 1);
@@ -292,8 +292,8 @@ void ConfigureTestServices(IServiceCollection services)
using var client = testFactory.CreateClient();
// Act
- using var response1 = await client.GetAsync("/api/values").ConfigureAwait(false);
- using var response2 = await client.GetAsync("/api/values/2").ConfigureAwait(false);
+ using var response1 = await client.GetAsync("/api/values");
+ using var response2 = await client.GetAsync("/api/values/2");
// Assert
response1.EnsureSuccessStatusCode(); // Status Code 200-299
@@ -344,8 +344,8 @@ void ConfigureTestServices(IServiceCollection services)
// Act
using (var inMemoryEventListener = new InMemoryEventListener(AspNetCoreInstrumentationEventSource.Log))
{
- using var response1 = await client.GetAsync("/api/values").ConfigureAwait(false);
- using var response2 = await client.GetAsync("/api/values/2").ConfigureAwait(false);
+ using var response1 = await client.GetAsync("/api/values");
+ using var response2 = await client.GetAsync("/api/values/2");
response1.EnsureSuccessStatusCode(); // Status Code 200-299
response2.EnsureSuccessStatusCode(); // Status Code 200-299
@@ -389,8 +389,8 @@ public async Task ExtractContextIrrespectiveOfSamplingDecision(SamplingDecision
// Test TraceContext Propagation
var request = new HttpRequestMessage(HttpMethod.Get, "/api/GetChildActivityTraceContext");
- var response = await client.SendAsync(request).ConfigureAwait(false);
- var childActivityTraceContext = JsonSerializer.Deserialize>(response.Content.ReadAsStringAsync().Result);
+ var response = await client.SendAsync(request);
+ var childActivityTraceContext = JsonSerializer.Deserialize>(await response.Content.ReadAsStringAsync());
response.EnsureSuccessStatusCode();
@@ -401,8 +401,8 @@ public async Task ExtractContextIrrespectiveOfSamplingDecision(SamplingDecision
// Test Baggage Context Propagation
request = new HttpRequestMessage(HttpMethod.Get, "/api/GetChildActivityBaggageContext");
- response = await client.SendAsync(request).ConfigureAwait(false);
- var childActivityBaggageContext = JsonSerializer.Deserialize>(response.Content.ReadAsStringAsync().Result);
+ response = await client.SendAsync(request);
+ var childActivityBaggageContext = JsonSerializer.Deserialize>(await response.Content.ReadAsStringAsync());
response.EnsureSuccessStatusCode();
@@ -455,12 +455,12 @@ public async Task ExtractContextIrrespectiveOfTheFilterApplied()
// Test TraceContext Propagation
var request = new HttpRequestMessage(HttpMethod.Get, "/api/GetChildActivityTraceContext");
- var response = await client.SendAsync(request).ConfigureAwait(false);
+ var response = await client.SendAsync(request);
// Ensure that filter was called
Assert.True(isFilterCalled);
- var childActivityTraceContext = JsonSerializer.Deserialize>(response.Content.ReadAsStringAsync().Result);
+ var childActivityTraceContext = JsonSerializer.Deserialize>(await response.Content.ReadAsStringAsync());
response.EnsureSuccessStatusCode();
@@ -471,8 +471,8 @@ public async Task ExtractContextIrrespectiveOfTheFilterApplied()
// Test Baggage Context Propagation
request = new HttpRequestMessage(HttpMethod.Get, "/api/GetChildActivityBaggageContext");
- response = await client.SendAsync(request).ConfigureAwait(false);
- var childActivityBaggageContext = JsonSerializer.Deserialize>(response.Content.ReadAsStringAsync().Result);
+ response = await client.SendAsync(request);
+ var childActivityBaggageContext = JsonSerializer.Deserialize>(await response.Content.ReadAsStringAsync());
response.EnsureSuccessStatusCode();
@@ -539,7 +539,7 @@ void ConfigureTestServices(IServiceCollection services)
request.Headers.TryAddWithoutValidation("baggage", "TestKey1=123,TestKey2=456");
// Act
- using var response = await client.SendAsync(request).ConfigureAwait(false);
+ using var response = await client.SendAsync(request);
}
stopSignal.WaitOne(5000);
@@ -593,7 +593,7 @@ void ConfigureTestServices(IServiceCollection services)
.CreateClient();
// Act
- using var response = await client.GetAsync("/api/values").ConfigureAwait(false);
+ using var response = await client.GetAsync("/api/values");
// Assert
Assert.Equal(shouldFilterBeCalled, filterCalled);
@@ -628,7 +628,7 @@ void ConfigureTestServices(IServiceCollection services)
})
.CreateClient())
{
- using var response = await client.GetAsync("/api/values/2").ConfigureAwait(false);
+ using var response = await client.GetAsync("/api/values/2");
response.EnsureSuccessStatusCode();
WaitForActivityExport(exportedItems, 2);
}
@@ -694,7 +694,7 @@ void ConfigureTestServices(IServiceCollection services)
try
{
- using var response = await client.SendAsync(message).ConfigureAwait(false);
+ using var response = await client.SendAsync(message);
response.EnsureSuccessStatusCode();
}
catch
@@ -747,7 +747,7 @@ public async Task ActivitiesStartedInMiddlewareBySettingHostActivityToNullShould
})
.CreateClient())
{
- using var response = await client.GetAsync("/api/values/2").ConfigureAwait(false);
+ using var response = await client.GetAsync("/api/values/2");
response.EnsureSuccessStatusCode();
WaitForActivityExport(exportedItems, 2);
}
@@ -797,7 +797,7 @@ void ConfigureTestServices(IServiceCollection services)
.CreateClient())
{
// Act
- using var response = await client.GetAsync("/api/values").ConfigureAwait(false);
+ using var response = await client.GetAsync("/api/values");
// Assert
response.EnsureSuccessStatusCode(); // Status Code 200-299
@@ -830,7 +830,7 @@ public async Task ShouldExportActivityWithOneOrMoreExceptionFilters(int mode)
.CreateClient())
{
// Act
- using var response = await client.GetAsync("/api/error").ConfigureAwait(false);
+ using var response = await client.GetAsync("/api/error");
WaitForActivityExport(exportedItems, 1);
}
@@ -896,7 +896,7 @@ void ConfigureTestServices(IServiceCollection services)
using var request = new HttpRequestMessage(HttpMethod.Get, "/api/values");
// Act
- using var response = await client.SendAsync(request).ConfigureAwait(false);
+ using var response = await client.SendAsync(request);
}
Assert.Equal(0, numberOfUnSubscribedEvents);
@@ -974,7 +974,7 @@ void ConfigureTestServices(IServiceCollection services)
using var request = new HttpRequestMessage(HttpMethod.Get, "/api/error");
// Act
- using var response = await client.SendAsync(request).ConfigureAwait(false);
+ using var response = await client.SendAsync(request);
}
catch
{
@@ -1045,7 +1045,7 @@ public async Task DiagnosticSourceExceptionCallBackIsNotReceivedForExceptionsHan
{
handler.Run(async (ctx) =>
{
- await ctx.Response.WriteAsync("handled").ConfigureAwait(false);
+ await ctx.Response.WriteAsync("handled");
});
});
@@ -1064,7 +1064,7 @@ static void ThrowException(IApplicationBuilder app)
using var client = new HttpClient();
try
{
- await client.GetStringAsync("http://localhost:5000/error").ConfigureAwait(false);
+ await client.GetStringAsync("http://localhost:5000/error");
}
catch
{
@@ -1075,7 +1075,7 @@ static void ThrowException(IApplicationBuilder app)
Assert.Equal(0, numberOfUnSubscribedEvents);
Assert.Equal(2, numberofSubscribedEvents);
- await app.DisposeAsync().ConfigureAwait(false);
+ await app.DisposeAsync();
}
[Fact]
@@ -1098,7 +1098,7 @@ public async Task RouteInformationIsNotAddedToRequestsOutsideOfMVC()
_ = app.RunAsync();
using var client = new HttpClient();
- var res = await client.GetStringAsync("http://localhost:5000/custom/abc").ConfigureAwait(false);
+ var res = await client.GetStringAsync("http://localhost:5000/custom/abc");
Assert.NotNull(res);
tracerprovider.ForceFlush();
@@ -1112,7 +1112,7 @@ public async Task RouteInformationIsNotAddedToRequestsOutsideOfMVC()
// We need to let End callback execute as it is executed AFTER response was returned.
// In unit tests environment there may be a lot of parallel unit tests executed, so
// giving some breezing room for the End callback to complete
- await Task.Delay(TimeSpan.FromSeconds(1)).ConfigureAwait(false);
+ await Task.Delay(TimeSpan.FromSeconds(1));
}
var activity = exportedItems[0];
@@ -1126,7 +1126,7 @@ public async Task RouteInformationIsNotAddedToRequestsOutsideOfMVC()
// After fix this should be /custom/{name:alpha}
Assert.Equal("/custom/abc", activity.DisplayName);
- await app.DisposeAsync().ConfigureAwait(false);
+ await app.DisposeAsync();
}
public void Dispose()
diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/IncomingRequestsCollectionsIsAccordingToTheSpecTests.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/IncomingRequestsCollectionsIsAccordingToTheSpecTests.cs
index 1059bee9281..d731b9f8881 100644
--- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/IncomingRequestsCollectionsIsAccordingToTheSpecTests.cs
+++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/IncomingRequestsCollectionsIsAccordingToTheSpecTests.cs
@@ -87,7 +87,7 @@ public async Task SuccessfulTemplateControllerCallGeneratesASpan_Old(
path += query;
}
- using var response = await client.GetAsync(path).ConfigureAwait(false);
+ using var response = await client.GetAsync(path);
}
catch (Exception)
{
@@ -104,7 +104,7 @@ public async Task SuccessfulTemplateControllerCallGeneratesASpan_Old(
// We need to let End callback execute as it is executed AFTER response was returned.
// In unit tests environment there may be a lot of parallel unit tests executed, so
// giving some breezing room for the End callback to complete
- await Task.Delay(TimeSpan.FromSeconds(1)).ConfigureAwait(false);
+ await Task.Delay(TimeSpan.FromSeconds(1));
}
}
@@ -176,7 +176,7 @@ public override async Task ProcessAsync(HttpContext context)
{
context.Response.StatusCode = this.statusCode;
context.Response.HttpContext.Features.Get().ReasonPhrase = this.reasonPhrase;
- await context.Response.WriteAsync("empty").ConfigureAwait(false);
+ await context.Response.WriteAsync("empty");
if (context.Request.Path.Value.EndsWith("exception"))
{
diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/IncomingRequestsCollectionsIsAccordingToTheSpecTests_Dupe.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/IncomingRequestsCollectionsIsAccordingToTheSpecTests_Dupe.cs
index 8bfe675ed5d..bb48d42c920 100644
--- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/IncomingRequestsCollectionsIsAccordingToTheSpecTests_Dupe.cs
+++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/IncomingRequestsCollectionsIsAccordingToTheSpecTests_Dupe.cs
@@ -87,7 +87,7 @@ public async Task SuccessfulTemplateControllerCallGeneratesASpan_Dupe(
path += query;
}
- using var response = await client.GetAsync(path).ConfigureAwait(false);
+ using var response = await client.GetAsync(path);
}
catch (Exception)
{
@@ -104,7 +104,7 @@ public async Task SuccessfulTemplateControllerCallGeneratesASpan_Dupe(
// We need to let End callback execute as it is executed AFTER response was returned.
// In unit tests environment there may be a lot of parallel unit tests executed, so
// giving some breezing room for the End callback to complete
- await Task.Delay(TimeSpan.FromSeconds(1)).ConfigureAwait(false);
+ await Task.Delay(TimeSpan.FromSeconds(1));
}
}
@@ -183,7 +183,7 @@ public override async Task ProcessAsync(HttpContext context)
{
context.Response.StatusCode = this.statusCode;
context.Response.HttpContext.Features.Get().ReasonPhrase = this.reasonPhrase;
- await context.Response.WriteAsync("empty").ConfigureAwait(false);
+ await context.Response.WriteAsync("empty");
if (context.Request.Path.Value.EndsWith("exception"))
{
diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/IncomingRequestsCollectionsIsAccordingToTheSpecTests_New.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/IncomingRequestsCollectionsIsAccordingToTheSpecTests_New.cs
index 5c56ffb6719..00da0c2ebd7 100644
--- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/IncomingRequestsCollectionsIsAccordingToTheSpecTests_New.cs
+++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/IncomingRequestsCollectionsIsAccordingToTheSpecTests_New.cs
@@ -87,7 +87,7 @@ public async Task SuccessfulTemplateControllerCallGeneratesASpan_New(
path += query;
}
- using var response = await client.GetAsync(path).ConfigureAwait(false);
+ using var response = await client.GetAsync(path);
}
catch (Exception)
{
@@ -104,7 +104,7 @@ public async Task SuccessfulTemplateControllerCallGeneratesASpan_New(
// We need to let End callback execute as it is executed AFTER response was returned.
// In unit tests environment there may be a lot of parallel unit tests executed, so
// giving some breezing room for the End callback to complete
- await Task.Delay(TimeSpan.FromSeconds(1)).ConfigureAwait(false);
+ await Task.Delay(TimeSpan.FromSeconds(1));
}
}
@@ -177,7 +177,7 @@ public override async Task ProcessAsync(HttpContext context)
{
context.Response.StatusCode = this.statusCode;
context.Response.HttpContext.Features.Get().ReasonPhrase = this.reasonPhrase;
- await context.Response.WriteAsync("empty").ConfigureAwait(false);
+ await context.Response.WriteAsync("empty");
if (context.Request.Path.Value.EndsWith("exception"))
{
diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/MetricTests.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/MetricTests.cs
index e1123b5d49f..1cb0a6ff2fb 100644
--- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/MetricTests.cs
+++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/MetricTests.cs
@@ -77,13 +77,13 @@ public async Task ValidateNet8MetricsAsync()
_ = app.RunAsync();
using var client = new HttpClient();
- var res = await client.GetStringAsync("http://localhost:5000/").ConfigureAwait(false);
+ var res = await client.GetStringAsync("http://localhost:5000/");
Assert.NotNull(res);
// We need to let metric callback execute as it is executed AFTER response was returned.
// In unit tests environment there may be a lot of parallel unit tests executed, so
// giving some breezing room for the callbacks to complete
- await Task.Delay(TimeSpan.FromSeconds(1)).ConfigureAwait(false);
+ await Task.Delay(TimeSpan.FromSeconds(1));
this.meterProvider.Dispose();
@@ -151,13 +151,13 @@ public async Task ValidateNet8RateLimitingMetricsAsync()
_ = app.RunAsync();
using var client = new HttpClient();
- var res = await client.GetStringAsync("http://localhost:5000/").ConfigureAwait(false);
+ var res = await client.GetStringAsync("http://localhost:5000/");
Assert.NotNull(res);
// We need to let metric callback execute as it is executed AFTER response was returned.
// In unit tests environment there may be a lot of parallel unit tests executed, so
// giving some breezing room for the callbacks to complete
- await Task.Delay(TimeSpan.FromSeconds(1)).ConfigureAwait(false);
+ await Task.Delay(TimeSpan.FromSeconds(1));
this.meterProvider.Dispose();
@@ -211,7 +211,7 @@ public async Task RequestMetricIsCaptured_New(string api, string expectedRoute,
{
try
{
- using var response = await client.GetAsync(api).ConfigureAwait(false);
+ using var response = await client.GetAsync(api);
response.EnsureSuccessStatusCode();
}
catch
@@ -223,7 +223,7 @@ public async Task RequestMetricIsCaptured_New(string api, string expectedRoute,
// We need to let End callback execute as it is executed AFTER response was returned.
// In unit tests environment there may be a lot of parallel unit tests executed, so
// giving some breezing room for the End callback to complete
- await Task.Delay(TimeSpan.FromSeconds(1)).ConfigureAwait(false);
+ await Task.Delay(TimeSpan.FromSeconds(1));
this.meterProvider.Dispose();
@@ -283,7 +283,7 @@ public async Task HttpRequestMethodIsCapturedAsPerSpec(string originalMethod, st
try
{
- using var response = await client.SendAsync(message).ConfigureAwait(false);
+ using var response = await client.SendAsync(message);
}
catch
{
@@ -293,7 +293,7 @@ public async Task HttpRequestMethodIsCapturedAsPerSpec(string originalMethod, st
// We need to let End callback execute as it is executed AFTER response was returned.
// In unit tests environment there may be a lot of parallel unit tests executed, so
// giving some breezing room for the End callback to complete
- await Task.Delay(TimeSpan.FromSeconds(1)).ConfigureAwait(false);
+ await Task.Delay(TimeSpan.FromSeconds(1));
this.meterProvider.Dispose();
@@ -344,8 +344,8 @@ public async Task RequestMetricIsCaptured_Old()
})
.CreateClient())
{
- using var response1 = await client.GetAsync("/api/values").ConfigureAwait(false);
- using var response2 = await client.GetAsync("/api/values/2").ConfigureAwait(false);
+ using var response1 = await client.GetAsync("/api/values");
+ using var response2 = await client.GetAsync("/api/values/2");
response1.EnsureSuccessStatusCode();
response2.EnsureSuccessStatusCode();
@@ -354,7 +354,7 @@ public async Task RequestMetricIsCaptured_Old()
// We need to let End callback execute as it is executed AFTER response was returned.
// In unit tests environment there may be a lot of parallel unit tests executed, so
// giving some breezing room for the End callback to complete
- await Task.Delay(TimeSpan.FromSeconds(1)).ConfigureAwait(false);
+ await Task.Delay(TimeSpan.FromSeconds(1));
this.meterProvider.Dispose();
@@ -395,8 +395,8 @@ public async Task RequestMetricIsCaptured_Dup()
})
.CreateClient())
{
- using var response1 = await client.GetAsync("/api/values").ConfigureAwait(false);
- using var response2 = await client.GetAsync("/api/values/2").ConfigureAwait(false);
+ using var response1 = await client.GetAsync("/api/values");
+ using var response2 = await client.GetAsync("/api/values/2");
response1.EnsureSuccessStatusCode();
response2.EnsureSuccessStatusCode();
@@ -405,7 +405,7 @@ public async Task RequestMetricIsCaptured_Dup()
// We need to let End callback execute as it is executed AFTER response was returned.
// In unit tests environment there may be a lot of parallel unit tests executed, so
// giving some breezing room for the End callback to complete
- await Task.Delay(TimeSpan.FromSeconds(1)).ConfigureAwait(false);
+ await Task.Delay(TimeSpan.FromSeconds(1));
this.meterProvider.Dispose();
diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTestFixture.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTestFixture.cs
index 1addda01cb6..0181e8dff8e 100644
--- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTestFixture.cs
+++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTestFixture.cs
@@ -51,7 +51,7 @@ public async Task MakeRequest(TestApplicationScenario scenario, string path)
var app = this.apps[scenario];
var baseUrl = app.Urls.First();
var url = $"{baseUrl}{path}";
- await HttpClient.GetAsync(url).ConfigureAwait(false);
+ await HttpClient.GetAsync(url);
}
public void AddTestResult(RoutingTestResult result)
diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTests.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTests.cs
index d8983db9d4d..7df25c7dc6a 100644
--- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTests.cs
+++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTests.cs
@@ -76,7 +76,7 @@ public async Task TestHttpRoute(RoutingTestCases.TestCase testCase, bool useLega
break;
}
- await Task.Delay(TimeSpan.FromSeconds(1)).ConfigureAwait(false);
+ await Task.Delay(TimeSpan.FromSeconds(1));
}
meterProvider.ForceFlush();
diff --git a/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTestHelpers/ClientTestHelpers.cs b/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTestHelpers/ClientTestHelpers.cs
index f2b34dee76d..66ad69a281c 100644
--- a/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTestHelpers/ClientTestHelpers.cs
+++ b/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTestHelpers/ClientTestHelpers.cs
@@ -64,11 +64,11 @@ public static async Task WriteResponseAsync(Stream ms, TResponse resp
data = response.ToByteArray();
}
- await ResponseUtils.WriteHeaderAsync(ms, data.Length, compress, CancellationToken.None).ConfigureAwait(false);
+ await ResponseUtils.WriteHeaderAsync(ms, data.Length, compress, CancellationToken.None);
#if NET5_0_OR_GREATER
- await ms.WriteAsync(data).ConfigureAwait(false);
+ await ms.WriteAsync(data);
#else
- await ms.WriteAsync(data, 0, data.Length).ConfigureAwait(false);
+ await ms.WriteAsync(data, 0, data.Length);
#endif
}
@@ -78,7 +78,7 @@ private static async Task CreateResponseContentCore(TR
var ms = new MemoryStream();
foreach (var response in responses)
{
- await WriteResponseAsync(ms, response, compressionProvider).ConfigureAwait(false);
+ await WriteResponseAsync(ms, response, compressionProvider);
}
ms.Seek(0, SeekOrigin.Begin);
diff --git a/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTestHelpers/TestHttpMessageHandler.cs b/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTestHelpers/TestHttpMessageHandler.cs
index e104f11acbc..e22fb6d7e17 100644
--- a/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTestHelpers/TestHttpMessageHandler.cs
+++ b/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTestHelpers/TestHttpMessageHandler.cs
@@ -37,8 +37,8 @@ public static TestHttpMessageHandler Create(Func tcs.TrySetCanceled());
- var result = await Task.WhenAny(sendAsync(request), tcs.Task).ConfigureAwait(false);
- return await result.ConfigureAwait(false);
+ var result = await Task.WhenAny(sendAsync(request), tcs.Task);
+ return await result;
});
}
diff --git a/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTests.client.cs b/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTests.client.cs
index 407b6d9ab39..a9a6ff901ed 100644
--- a/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTests.client.cs
+++ b/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTests.client.cs
@@ -55,7 +55,7 @@ public void GrpcClientCallsAreCollectedSuccessfully(string baseAddress, bool sho
using var httpClient = ClientTestHelpers.CreateTestClient(async request =>
{
- var streamContent = await ClientTestHelpers.CreateResponseContent(new HelloReply()).ConfigureAwait(false);
+ var streamContent = await ClientTestHelpers.CreateResponseContent(new HelloReply());
var response = ResponseUtils.CreateResponse(HttpStatusCode.OK, streamContent, grpcStatusCode: global::Grpc.Core.StatusCode.OK);
response.TrailingHeaders().Add("grpc-message", "value");
return response;
@@ -150,7 +150,7 @@ public void GrpcClientCallsAreCollectedSuccessfully_New(string baseAddress, bool
using var httpClient = ClientTestHelpers.CreateTestClient(async request =>
{
- var streamContent = await ClientTestHelpers.CreateResponseContent(new HelloReply()).ConfigureAwait(false);
+ var streamContent = await ClientTestHelpers.CreateResponseContent(new HelloReply());
var response = ResponseUtils.CreateResponse(HttpStatusCode.OK, streamContent, grpcStatusCode: global::Grpc.Core.StatusCode.OK);
response.TrailingHeaders().Add("grpc-message", "value");
return response;
@@ -246,7 +246,7 @@ public void GrpcClientCallsAreCollectedSuccessfully_Dupe(string baseAddress, boo
using var httpClient = ClientTestHelpers.CreateTestClient(async request =>
{
- var streamContent = await ClientTestHelpers.CreateResponseContent(new HelloReply()).ConfigureAwait(false);
+ var streamContent = await ClientTestHelpers.CreateResponseContent(new HelloReply());
var response = ResponseUtils.CreateResponse(HttpStatusCode.OK, streamContent, grpcStatusCode: global::Grpc.Core.StatusCode.OK);
response.TrailingHeaders().Add("grpc-message", "value");
return response;
diff --git a/test/OpenTelemetry.Instrumentation.Grpc.Tests/Services/GreeterService.cs b/test/OpenTelemetry.Instrumentation.Grpc.Tests/Services/GreeterService.cs
index cf444b2a2c5..70c6ff5636e 100644
--- a/test/OpenTelemetry.Instrumentation.Grpc.Tests/Services/GreeterService.cs
+++ b/test/OpenTelemetry.Instrumentation.Grpc.Tests/Services/GreeterService.cs
@@ -42,10 +42,10 @@ public override async Task SayHellos(HelloRequest request, IServerStreamWriter e.EventId == 4));
}
@@ -614,7 +614,7 @@ public async Task ReportsExceptionEventForNetworkFailuresWithGetAsync()
using var c = new HttpClient();
try
{
- await c.GetAsync("https://sdlfaldfjalkdfjlkajdflkajlsdjf.sdlkjafsdjfalfadslkf.com/").ConfigureAwait(false);
+ await c.GetAsync("https://sdlfaldfjalkdfjlkajdflkajlsdjf.sdlkjafsdjfalfadslkf.com/");
}
catch
{
@@ -640,7 +640,7 @@ public async Task DoesNotReportExceptionEventOnErrorResponseWithGetAsync()
using var c = new HttpClient();
try
{
- await c.GetAsync($"{this.url}500").ConfigureAwait(false);
+ await c.GetAsync($"{this.url}500");
}
catch
{
@@ -671,7 +671,7 @@ public async Task DoesNotReportExceptionEventOnErrorResponseWithGetStringAsync()
using var c = new HttpClient();
try
{
- await c.GetStringAsync($"{this.url}500").ConfigureAwait(false);
+ await c.GetStringAsync($"{this.url}500");
}
catch
{
@@ -746,7 +746,7 @@ public async Task CustomPropagatorCalled(bool sample, bool createParentActivity)
};
using var c = new HttpClient();
- await c.SendAsync(request).ConfigureAwait(false);
+ await c.SendAsync(request);
parent?.Stop();
diff --git a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.cs b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.cs
index 8a57b5c1651..ec7b4aac2ee 100644
--- a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.cs
+++ b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.cs
@@ -46,7 +46,7 @@ await HttpOutCallsAreCollectedSuccessfullyBodyAsync(
tc,
enableTracing: true,
enableMetrics: true,
- semanticConvention: HttpSemanticConvention.Old).ConfigureAwait(false);
+ semanticConvention: HttpSemanticConvention.Old);
}
[Theory]
@@ -59,7 +59,7 @@ await HttpOutCallsAreCollectedSuccessfullyBodyAsync(
tc,
enableTracing: true,
enableMetrics: true,
- semanticConvention: HttpSemanticConvention.Dupe).ConfigureAwait(false);
+ semanticConvention: HttpSemanticConvention.Dupe);
}
#endif
@@ -73,7 +73,7 @@ await HttpOutCallsAreCollectedSuccessfullyBodyAsync(
tc,
enableTracing: true,
enableMetrics: true,
- semanticConvention: HttpSemanticConvention.New).ConfigureAwait(false);
+ semanticConvention: HttpSemanticConvention.New);
}
[Theory]
@@ -85,7 +85,7 @@ await HttpOutCallsAreCollectedSuccessfullyBodyAsync(
this.port,
tc,
enableTracing: false,
- enableMetrics: true).ConfigureAwait(false);
+ enableMetrics: true);
}
[Theory]
@@ -97,7 +97,7 @@ await HttpOutCallsAreCollectedSuccessfullyBodyAsync(
this.port,
tc,
enableTracing: true,
- enableMetrics: false).ConfigureAwait(false);
+ enableMetrics: false);
}
[Theory]
@@ -109,7 +109,7 @@ await HttpOutCallsAreCollectedSuccessfullyBodyAsync(
this.port,
tc,
enableTracing: false,
- enableMetrics: false).ConfigureAwait(false);
+ enableMetrics: false);
}
#if !NET8_0_OR_GREATER
@@ -143,15 +143,15 @@ public async Task DebugIndividualTestAsync()
new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase });
var t = (Task)this.GetType().InvokeMember(nameof(this.HttpOutCallsAreCollectedSuccessfullyTracesAndMetricsOldSemanticConventionsAsync), BindingFlags.InvokeMethod, null, this, HttpTestData.GetArgumentsFromTestCaseObject(input).First());
- await t.ConfigureAwait(false);
+ await t;
}
#endif
[Fact]
public async Task CheckEnrichmentWhenSampling()
{
- await CheckEnrichment(new AlwaysOffSampler(), false, this.url).ConfigureAwait(false);
- await CheckEnrichment(new AlwaysOnSampler(), true, this.url).ConfigureAwait(false);
+ await CheckEnrichment(new AlwaysOffSampler(), false, this.url);
+ await CheckEnrichment(new AlwaysOnSampler(), true, this.url);
}
#if NET8_0_OR_GREATER
@@ -178,7 +178,7 @@ public async Task ValidateNet8MetricsAsync(HttpTestData.HttpOutTestCase tc)
request.Headers.Add("contextRequired", "false");
request.Headers.Add("responseCode", (tc.ResponseCode == 0 ? 200 : tc.ResponseCode).ToString());
- await c.SendAsync(request).ConfigureAwait(false);
+ await c.SendAsync(request);
}
catch (Exception)
{
@@ -286,7 +286,7 @@ private static async Task HttpOutCallsAreCollectedSuccessfullyBodyAsync(
request.Headers.Add("contextRequired", "false");
request.Headers.Add("responseCode", (tc.ResponseCode == 0 ? 200 : tc.ResponseCode).ToString());
- await c.SendAsync(request).ConfigureAwait(false);
+ await c.SendAsync(request);
}
catch (Exception)
{
@@ -643,7 +643,7 @@ private static async Task CheckEnrichment(Sampler sampler, bool enrichExpected,
.Build())
{
using var c = new HttpClient();
- using var r = await c.GetAsync(url).ConfigureAwait(false);
+ using var r = await c.GetAsync(url);
}
if (enrichExpected)
diff --git a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestActivitySourceTests.netfx.cs b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestActivitySourceTests.netfx.cs
index 074ae7df55c..9dbdb162fb7 100644
--- a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestActivitySourceTests.netfx.cs
+++ b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestActivitySourceTests.netfx.cs
@@ -155,7 +155,7 @@ public async Task TestReflectInitializationViaSubscription()
// Send a random Http request to generate some events
using (var client = new HttpClient())
{
- (await client.GetAsync(this.BuildRequestUrl()).ConfigureAwait(false)).Dispose();
+ (await client.GetAsync(this.BuildRequestUrl())).Dispose();
}
// Just make sure some events are written, to confirm we successfully subscribed to it.
@@ -180,8 +180,8 @@ public async Task TestBasicReceiveAndResponseEvents(string method, string queryS
using (var client = new HttpClient())
{
(method == "GET"
- ? await client.GetAsync(url).ConfigureAwait(false)
- : await client.PostAsync(url, new StringContent("hello world")).ConfigureAwait(false)).Dispose();
+ ? await client.GetAsync(url)
+ : await client.PostAsync(url, new StringContent("hello world"))).Dispose();
}
// We should have exactly one Start and one Stop event
@@ -211,8 +211,8 @@ public async Task TestBasicReceiveAndResponseEventsWithoutSampling(string method
using (var client = new HttpClient())
{
(method == "GET"
- ? await client.GetAsync(this.BuildRequestUrl()).ConfigureAwait(false)
- : await client.PostAsync(this.BuildRequestUrl(), new StringContent("hello world")).ConfigureAwait(false)).Dispose();
+ ? await client.GetAsync(this.BuildRequestUrl())
+ : await client.PostAsync(this.BuildRequestUrl(), new StringContent("hello world"))).Dispose();
}
// There should be no events because we turned off sampling.
@@ -248,7 +248,7 @@ public async Task TestBasicReceiveAndResponseWebRequestEvents(string method, int
stream = webRequest.GetRequestStream();
break;
case 1:
- stream = await webRequest.GetRequestStreamAsync().ConfigureAwait(false);
+ stream = await webRequest.GetRequestStreamAsync();
break;
case 2:
{
@@ -310,7 +310,7 @@ public async Task TestBasicReceiveAndResponseWebRequestEvents(string method, int
webResponse = webRequest.GetResponse();
break;
case 1:
- webResponse = await webRequest.GetResponseAsync().ConfigureAwait(false);
+ webResponse = await webRequest.GetResponseAsync();
break;
case 2:
{
@@ -397,7 +397,7 @@ public async Task TestTraceStateAndBaggage()
// Send a random Http request to generate some events
using (var client = new HttpClient())
{
- (await client.GetAsync(this.BuildRequestUrl()).ConfigureAwait(false)).Dispose();
+ (await client.GetAsync(this.BuildRequestUrl())).Dispose();
}
parent.Stop();
@@ -438,7 +438,7 @@ public async Task DoNotInjectTraceParentWhenPresent(string method)
request.Content = new StringContent("hello world");
}
- (await client.SendAsync(request).ConfigureAwait(false)).Dispose();
+ (await client.SendAsync(request)).Dispose();
}
// No events are sent.
@@ -466,8 +466,8 @@ public async Task TestResponseWithoutContentEvents(string method)
using (var client = new HttpClient())
{
using HttpResponseMessage response = method == "GET"
- ? await client.GetAsync(url).ConfigureAwait(false)
- : await client.PostAsync(url, new StringContent("hello world")).ConfigureAwait(false);
+ ? await client.GetAsync(url)
+ : await client.PostAsync(url, new StringContent("hello world"));
}
// We should have exactly one Start and one Stop event
@@ -499,8 +499,8 @@ public async Task TestRedirectedRequest(string method)
using (var client = new HttpClient())
{
using HttpResponseMessage response = method == "GET"
- ? await client.GetAsync(this.BuildRequestUrl(queryString: "redirects=10")).ConfigureAwait(false)
- : await client.PostAsync(this.BuildRequestUrl(queryString: "redirects=10"), new StringContent("hello world")).ConfigureAwait(false);
+ ? await client.GetAsync(this.BuildRequestUrl(queryString: "redirects=10"))
+ : await client.PostAsync(this.BuildRequestUrl(queryString: "redirects=10"), new StringContent("hello world"));
}
// We should have exactly one Start and one Stop event
@@ -529,7 +529,7 @@ public async Task TestRequestWithException(string method)
return method == "GET"
? new HttpClient().GetAsync(url)
: new HttpClient().PostAsync(url, new StringContent("hello world"));
- }).ConfigureAwait(false);
+ });
// check that request failed because of the wrong domain name and not because of reflection
var webException = (WebException)ex.InnerException;
@@ -572,7 +572,7 @@ public async Task TestCanceledRequest(string method)
return method == "GET"
? client.GetAsync(url, cts.Token)
: client.PostAsync(url, new StringContent("hello world"), cts.Token);
- }).ConfigureAwait(false);
+ });
Assert.True(ex is TaskCanceledException || ex is WebException);
}
@@ -611,7 +611,7 @@ public async Task TestSecureTransportFailureRequest(string method)
return method == "GET"
? client.GetAsync(url)
: client.PostAsync(url, new StringContent("hello world"));
- }).ConfigureAwait(false);
+ });
Assert.True(ex is HttpRequestException);
}
@@ -653,7 +653,7 @@ public async Task TestSecureTransportRetryFailureRequest(string method)
return method == "GET"
? client.GetAsync(url)
: client.PostAsync(url, new StringContent("hello world"));
- }).ConfigureAwait(false);
+ });
Assert.True(ex is HttpRequestException);
}
@@ -685,7 +685,7 @@ public async Task TestInvalidBaggage()
using (var client = new HttpClient())
{
- (await client.GetAsync(this.BuildRequestUrl()).ConfigureAwait(false)).Dispose();
+ (await client.GetAsync(this.BuildRequestUrl())).Dispose();
}
Assert.Equal(2, eventRecords.Records.Count());
@@ -699,7 +699,7 @@ public async Task TestInvalidBaggage()
/// Test to make sure every event record has the right dynamic properties.
///
[Fact]
- public void TestMultipleConcurrentRequests()
+ public async Task TestMultipleConcurrentRequests()
{
ServicePointManager.DefaultConnectionLimit = int.MaxValue;
using var parentActivity = new Activity("parent").Start();
@@ -724,13 +724,13 @@ public void TestMultipleConcurrentRequests()
}
// wait up to 10 sec for all requests and suppress exceptions
- Task.WhenAll(tasks.Select(t => t.Value).ToArray()).ContinueWith(tt =>
+ await Task.WhenAll(tasks.Select(t => t.Value).ToArray()).ContinueWith(async tt =>
{
foreach (var task in tasks)
{
- task.Value.Result?.Dispose();
+ (await task.Value)?.Dispose();
}
- }).Wait();
+ });
// Examine the result. Make sure we got all successful requests.
diff --git a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestTests.Basic.cs b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestTests.Basic.cs
index 85ab9988335..40f0cf9a873 100644
--- a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestTests.Basic.cs
+++ b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestTests.Basic.cs
@@ -87,7 +87,7 @@ public async Task BacksOffIfAlreadyInstrumented()
request.Headers.Add("traceparent", "00-0123456789abcdef0123456789abcdef-0123456789abcdef-01");
- using var response = await request.GetResponseAsync().ConfigureAwait(false);
+ using var response = await request.GetResponseAsync();
#if NETFRAMEWORK
// Note: Back-off is part of the .NET Framework reflection only and
@@ -129,7 +129,7 @@ public async Task RequestNotCollectedWhenInstrumentationFilterApplied()
request.Method = "GET";
- using var response = await request.GetResponseAsync().ConfigureAwait(false);
+ using var response = await request.GetResponseAsync();
#if NETFRAMEWORK
Assert.True(httpWebRequestFilterApplied);
@@ -163,7 +163,7 @@ public async Task RequestNotCollectedWhenInstrumentationFilterThrowsException()
request.Method = "GET";
- using var response = await request.GetResponseAsync().ConfigureAwait(false);
+ using var response = await request.GetResponseAsync();
Assert.Single(inMemoryEventListener.Events.Where((e) => e.EventId == 4));
}
@@ -190,7 +190,7 @@ public async Task InjectsHeadersAsync()
parent.TraceStateString = "k1=v1,k2=v2";
parent.ActivityTraceFlags = ActivityTraceFlags.Recorded;
- using var response = await request.GetResponseAsync().ConfigureAwait(false);
+ using var response = await request.GetResponseAsync();
Assert.Equal(3, activityProcessor.Invocations.Count); // SetParentProvider/Begin/End called
var activity = (Activity)activityProcessor.Invocations[2].Arguments[0];
@@ -272,7 +272,7 @@ public async Task CustomPropagatorCalled(bool sample, bool createParentActivity)
request.Method = "GET";
- using var response = await request.GetResponseAsync().ConfigureAwait(false);
+ using var response = await request.GetResponseAsync();
parent?.Stop();
@@ -345,7 +345,7 @@ public async Task ReportsExceptionEventForNetworkFailures()
request.Method = "GET";
- using var response = await request.GetResponseAsync().ConfigureAwait(false);
+ using var response = await request.GetResponseAsync();
}
catch
{
@@ -374,7 +374,7 @@ public async Task ReportsExceptionEventOnErrorResponse()
request.Method = "GET";
- using var response = await request.GetResponseAsync().ConfigureAwait(false);
+ using var response = await request.GetResponseAsync();
}
catch
{
diff --git a/test/OpenTelemetry.Instrumentation.Http.Tests/RetryHandler.cs b/test/OpenTelemetry.Instrumentation.Http.Tests/RetryHandler.cs
index 1ba12c16768..7d3b28b3b75 100644
--- a/test/OpenTelemetry.Instrumentation.Http.Tests/RetryHandler.cs
+++ b/test/OpenTelemetry.Instrumentation.Http.Tests/RetryHandler.cs
@@ -41,7 +41,7 @@ protected override async Task SendAsync(
try
{
- response = await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
+ response = await base.SendAsync(request, cancellationToken);
}
catch
{
diff --git a/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlEventSourceTests.netfx.cs b/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlEventSourceTests.netfx.cs
index 131f5622b02..2df68ac8d31 100644
--- a/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlEventSourceTests.netfx.cs
+++ b/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlEventSourceTests.netfx.cs
@@ -59,7 +59,7 @@ public async Task SuccessfulCommandTest(CommandType commandType, string commandT
using SqlConnection sqlConnection = new SqlConnection(SqlConnectionString);
- await sqlConnection.OpenAsync().ConfigureAwait(false);
+ await sqlConnection.OpenAsync();
string dataSource = sqlConnection.DataSource;
@@ -72,7 +72,7 @@ public async Task SuccessfulCommandTest(CommandType commandType, string commandT
try
{
- await sqlCommand.ExecuteNonQueryAsync().ConfigureAwait(false);
+ await sqlCommand.ExecuteNonQueryAsync();
}
catch
{
diff --git a/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/Dockerfile b/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/Dockerfile
index 0508036d3e8..9723867f4f3 100644
--- a/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/Dockerfile
+++ b/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/Dockerfile
@@ -2,8 +2,8 @@
# This should be run from the root of the repo:
# docker build --file test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/Dockerfile .
-ARG BUILD_SDK_VERSION=7.0
-ARG TEST_SDK_VERSION=7.0
+ARG BUILD_SDK_VERSION=8.0
+ARG TEST_SDK_VERSION=8.0
FROM ubuntu AS w3c
#Install git
@@ -13,7 +13,7 @@ RUN git clone --branch level-1 https://github.com/w3c/trace-context.git
FROM mcr.microsoft.com/dotnet/sdk:${BUILD_SDK_VERSION} AS build
ARG PUBLISH_CONFIGURATION=Release
-ARG PUBLISH_FRAMEWORK=net7.0
+ARG PUBLISH_FRAMEWORK=net8.0
WORKDIR /repo
COPY . ./
WORKDIR "/repo/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests"
diff --git a/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/W3CTraceContextTests.cs b/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/W3CTraceContextTests.cs
index e7ae8a783d3..05d8bd919d5 100644
--- a/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/W3CTraceContextTests.cs
+++ b/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/W3CTraceContextTests.cs
@@ -71,7 +71,7 @@ public void W3CTraceContextTestSuiteAsync(string value)
Encoding.UTF8,
"application/json"),
};
- await this.httpClient.SendAsync(request).ConfigureAwait(false);
+ await this.httpClient.SendAsync(request);
}
}
else
diff --git a/test/OpenTelemetry.Tests.Stress.Metrics/README.md b/test/OpenTelemetry.Tests.Stress.Metrics/README.md
index c05f1c6758e..13ce3faf073 100644
--- a/test/OpenTelemetry.Tests.Stress.Metrics/README.md
+++ b/test/OpenTelemetry.Tests.Stress.Metrics/README.md
@@ -15,5 +15,5 @@ for `Counter` and uncomment everything related to `Histogram` in the
Open a console, run the following command from the current folder:
```sh
-dotnet run --framework net7.0 --configuration Release
+dotnet run --framework net8.0 --configuration Release
```
diff --git a/test/OpenTelemetry.Tests/Internal/CircularBufferTest.cs b/test/OpenTelemetry.Tests/Internal/CircularBufferTest.cs
index 2fc427e3ff0..d8307c1dab9 100644
--- a/test/OpenTelemetry.Tests/Internal/CircularBufferTest.cs
+++ b/test/OpenTelemetry.Tests/Internal/CircularBufferTest.cs
@@ -129,7 +129,7 @@ public async Task CpuPressureTest()
tasks.Add(Task.Run(async () =>
{
- await Task.Delay(2000).ConfigureAwait(false);
+ await Task.Delay(2000);
if (tid == 0)
{
@@ -167,6 +167,6 @@ public async Task CpuPressureTest()
}));
}
- await Task.WhenAll(tasks).ConfigureAwait(false);
+ await Task.WhenAll(tasks);
}
}
diff --git a/test/OpenTelemetry.Tests/Logs/LogRecordSharedPoolTests.cs b/test/OpenTelemetry.Tests/Logs/LogRecordSharedPoolTests.cs
index fd330dd0694..8d90505ffad 100644
--- a/test/OpenTelemetry.Tests/Logs/LogRecordSharedPoolTests.cs
+++ b/test/OpenTelemetry.Tests/Logs/LogRecordSharedPoolTests.cs
@@ -190,7 +190,7 @@ public async Task ExportTest(bool warmup)
{
Random random = new Random();
- await Task.Delay(random.Next(100, 150)).ConfigureAwait(false);
+ await Task.Delay(random.Next(100, 150));
for (int i = 0; i < 1000; i++)
{
@@ -201,12 +201,12 @@ public async Task ExportTest(bool warmup)
// This should no-op mostly.
pool.Return(logRecord);
- await Task.Delay(random.Next(0, 20)).ConfigureAwait(false);
+ await Task.Delay(random.Next(0, 20));
}
}));
}
- await Task.WhenAll(tasks).ConfigureAwait(false);
+ await Task.WhenAll(tasks);
processor.ForceFlush();
@@ -248,7 +248,7 @@ public async Task DeadlockTest()
{
tasks.Add(Task.Run(async () =>
{
- await Task.Delay(2000).ConfigureAwait(false);
+ await Task.Delay(2000);
for (int i = 0; i < 100_000; i++)
{
@@ -259,7 +259,7 @@ public async Task DeadlockTest()
}));
}
- await Task.WhenAll(tasks).ConfigureAwait(false);
+ await Task.WhenAll(tasks);
Assert.True(pool.Count <= LogRecordSharedPool.DefaultMaxPoolSize);
}
diff --git a/test/OpenTelemetry.Tests/Shared/TestHttpServer.cs b/test/OpenTelemetry.Tests/Shared/TestHttpServer.cs
index b59062f1042..7c69b4a455e 100644
--- a/test/OpenTelemetry.Tests/Shared/TestHttpServer.cs
+++ b/test/OpenTelemetry.Tests/Shared/TestHttpServer.cs
@@ -76,7 +76,7 @@ public RunningServer(Action action, string host, int port)
this.initialized.Set();
- action(await ctxTask.ConfigureAwait(false));
+ action(await ctxTask);
}
catch (Exception ex)
{
diff --git a/test/OpenTelemetry.Tests/SuppressInstrumentationTest.cs b/test/OpenTelemetry.Tests/SuppressInstrumentationTest.cs
index ad49fb7e233..6c839b4f061 100644
--- a/test/OpenTelemetry.Tests/SuppressInstrumentationTest.cs
+++ b/test/OpenTelemetry.Tests/SuppressInstrumentationTest.cs
@@ -74,7 +74,7 @@ await Task.Factory.StartNew(() =>
Assert.False(Sdk.SuppressInstrumentation);
Assert.Equal(1, SuppressInstrumentationScope.Enter());
Assert.True(Sdk.SuppressInstrumentation);
- }).ConfigureAwait(false);
+ });
Assert.False(Sdk.SuppressInstrumentation); // Changes made by SuppressInstrumentationScope.Enter in the task above are not reflected here as it's not part of the same async flow
}
diff --git a/test/TestApp.AspNetCore/ActivityMiddleware.cs b/test/TestApp.AspNetCore/ActivityMiddleware.cs
index 3fa497a878e..2da1225c3b0 100644
--- a/test/TestApp.AspNetCore/ActivityMiddleware.cs
+++ b/test/TestApp.AspNetCore/ActivityMiddleware.cs
@@ -34,7 +34,7 @@ public async Task InvokeAsync(HttpContext context)
this.impl.PreProcess(context);
}
- await this.next(context).ConfigureAwait(false);
+ await this.next(context);
if (this.impl != null)
{
diff --git a/test/TestApp.AspNetCore/CallbackMiddleware.cs b/test/TestApp.AspNetCore/CallbackMiddleware.cs
index 2f6a4085859..0a79505a5bd 100644
--- a/test/TestApp.AspNetCore/CallbackMiddleware.cs
+++ b/test/TestApp.AspNetCore/CallbackMiddleware.cs
@@ -29,9 +29,9 @@ public CallbackMiddleware(RequestDelegate next, CallbackMiddlewareImpl impl)
public async Task InvokeAsync(HttpContext context)
{
- if (this.impl == null || await this.impl.ProcessAsync(context).ConfigureAwait(false))
+ if (this.impl == null || await this.impl.ProcessAsync(context))
{
- await this.next(context).ConfigureAwait(false);
+ await this.next(context);
}
}
@@ -39,7 +39,7 @@ public class CallbackMiddlewareImpl
{
public virtual async Task ProcessAsync(HttpContext context)
{
- return await Task.FromResult(true).ConfigureAwait(false);
+ return await Task.FromResult(true);
}
}
}