more audit work
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
using System.Net.Http.Json;
|
||||
using Xunit.Sdk;
|
||||
|
||||
namespace StellaOps.Chaos.Router.Tests.Fixtures;
|
||||
|
||||
@@ -57,10 +58,18 @@ public class RouterTestFixture : IAsyncLifetime
|
||||
return JsonContent.Create(request);
|
||||
}
|
||||
|
||||
public ValueTask InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
// Verify router is reachable
|
||||
return ValueTask.CompletedTask;
|
||||
try
|
||||
{
|
||||
using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(2));
|
||||
_ = await _client.GetAsync("/", cts.Token);
|
||||
}
|
||||
catch (Exception ex) when (ex is HttpRequestException || ex is TaskCanceledException || ex is OperationCanceledException)
|
||||
{
|
||||
throw SkipException.ForSkip(
|
||||
$"Router not reachable at '{_routerUrl}'. Set ROUTER_URL or start the router service to run chaos tests.");
|
||||
}
|
||||
}
|
||||
|
||||
public ValueTask DisposeAsync()
|
||||
|
||||
Reference in New Issue
Block a user