fix: address MonitorServer review — dispose resources, add cancellation, improve test reliability
This commit is contained in:
@@ -27,8 +27,17 @@ public class MonitorTests : IAsyncLifetime
|
||||
{
|
||||
_ = _server.StartAsync(_cts.Token);
|
||||
await _server.WaitForReadyAsync();
|
||||
// Give monitoring server time to start
|
||||
await Task.Delay(200);
|
||||
// Wait for monitoring HTTP server to be ready
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await _http.GetAsync($"http://127.0.0.1:{_monitorPort}/healthz");
|
||||
if (response.IsSuccessStatusCode) break;
|
||||
}
|
||||
catch (HttpRequestException) { }
|
||||
await Task.Delay(50);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task DisposeAsync()
|
||||
|
||||
Reference in New Issue
Block a user