From 52559befa8a1b4605cf54411cac3104858f46cbf Mon Sep 17 00:00:00 2001 From: Mikel Blanchard Date: Mon, 27 Sep 2021 15:42:51 -0700 Subject: [PATCH] Attempting to stabilize TestHttpServer tests. (#2415) --- test/OpenTelemetry.Tests/Shared/TestHttpServer.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/OpenTelemetry.Tests/Shared/TestHttpServer.cs b/test/OpenTelemetry.Tests/Shared/TestHttpServer.cs index 1f56b2d76af..921502f6f97 100644 --- a/test/OpenTelemetry.Tests/Shared/TestHttpServer.cs +++ b/test/OpenTelemetry.Tests/Shared/TestHttpServer.cs @@ -100,7 +100,8 @@ public void Dispose() { try { - this.listener?.Stop(); + this.listener.Close(); + this.httpListenerTask?.Wait(); } catch (ObjectDisposedException) {