You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by bl...@apache.org on 2020/03/28 08:11:56 UTC

[pulsar-dotpulsar] 02/02: fixes to test fixture class

This is an automated email from the ASF dual-hosted git repository.

blankensteiner pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-dotpulsar.git

commit 78bdf26887fea2f0b3878b85c291fb5e4851788c
Author: Vince Pergolizzi <pe...@gmail.com>
AuthorDate: Sat Mar 28 03:10:11 2020 -0400

    fixes to test fixture class
---
 .../Fixtures/StandaloneClusterFixture.cs                  | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/DotPulsar.Stress.Tests/Fixtures/StandaloneClusterFixture.cs b/src/DotPulsar.Stress.Tests/Fixtures/StandaloneClusterFixture.cs
index 36ff0f1..fff27ed 100644
--- a/src/DotPulsar.Stress.Tests/Fixtures/StandaloneClusterFixture.cs
+++ b/src/DotPulsar.Stress.Tests/Fixtures/StandaloneClusterFixture.cs
@@ -6,7 +6,7 @@ using Xunit;
 
 namespace DotPulsar.Stress.Tests.Fixtures
 {
-    public class StandaloneClusterFixture : IDisposable, IAsyncLifetime
+    public class StandaloneClusterFixture : IAsyncLifetime
     {
         public async Task InitializeAsync()
         {
@@ -16,21 +16,22 @@ namespace DotPulsar.Stress.Tests.Fixtures
             RunProcess("docker-compose", "-f docker-compose-standalone-tests.yml up -d");
 
             int waitTries = 10;
-            var handler = new HttpClientHandler();
+
+            using var handler = new HttpClientHandler();
             handler.AllowAutoRedirect = true;
-            var client = new HttpClient(handler);
+            using var client = new HttpClient(handler);
 
             while (waitTries > 0)
             {
                 try
                 {
-                    await client.GetAsync("http://localhost:8080/metrics/");
+                    await client.GetAsync("http://localhost:8080/metrics/").ConfigureAwait(false);
                     return;
                 }
                 catch (Exception ex)
                 {
                     waitTries--;
-                    await Task.Delay(5000);
+                    await Task.Delay(5000).ConfigureAwait(false);
                 }
             }
 
@@ -39,10 +40,6 @@ namespace DotPulsar.Stress.Tests.Fixtures
 
         public async Task DisposeAsync()
         {
-        }
-
-        public void Dispose()
-        {
             RunProcess("docker-compose", "-f docker-compose-standalone-tests.yml down");
         }