Skip to content

Commit

Permalink
* Increase wait time in test for CI.
Browse files Browse the repository at this point in the history
* Ensure toxiproxy proxy is deleted before trying to create it.
  • Loading branch information
lukebakken committed Mar 27, 2024
1 parent d459310 commit dd9da1f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
8 changes: 7 additions & 1 deletion projects/Test/Integration/TestConnectionShutdown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,13 @@ public async Task TestDisposedWithSocketClosedOutOfBand()

_conn.Dispose();
_conn = null;
await WaitAsync(tcs, TimeSpan.FromSeconds(3), "channel shutdown");

TimeSpan waitSpan = TimeSpan.FromSeconds(3);
if (IsRunningInCI)
{
waitSpan = TimeSpan.FromSeconds(10);
}
await WaitAsync(tcs, waitSpan, "channel shutdown");
}

[Fact]
Expand Down
16 changes: 10 additions & 6 deletions projects/Test/Integration/TestToxiproxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public TestToxiproxy(ITestOutputHelper output) : base(output)
}
}

public override Task InitializeAsync()
public override async Task InitializeAsync()
{
// NB: nothing to do here since each test creates its own factory,
// connections and channels
Expand All @@ -94,11 +94,15 @@ public override Task InitializeAsync()

if (AreToxiproxyTestsEnabled)
{
return _proxyClient.AddAsync(_rmqProxy);
}
else
{
return Task.CompletedTask;
try
{
await _proxyClient.DeleteAsync(_rmqProxy);
}
catch
{
}

await _proxyClient.AddAsync(_rmqProxy);
}
}

Expand Down

0 comments on commit dd9da1f

Please sign in to comment.