Centralize test timeout constants to fix CI flakiness (#1224)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ericstj <8918108+ericstj@users.noreply.github.com> Co-authored-by: Eric StJohn <ericstj@microsoft.com>
This commit is contained in:
parent
283caf9810
commit
a83d6198a5
1 changed files with 43 additions and 6 deletions
|
|
@ -1,5 +1,6 @@
|
|||
using System.Diagnostics;
|
||||
using System.Net;
|
||||
using ModelContextProtocol.Tests.Utils;
|
||||
|
||||
namespace ModelContextProtocol.Tests;
|
||||
|
||||
|
|
@ -33,7 +34,7 @@ public class EverythingSseServerFixture : IAsyncDisposable
|
|||
?? throw new InvalidOperationException($"Could not start process for {processStartInfo.FileName} with '{processStartInfo.Arguments}'.");
|
||||
|
||||
// Poll until the server is ready (up to 30 seconds)
|
||||
using var httpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(2) };
|
||||
using var httpClient = new HttpClient { Timeout = TestConstants.HttpClientPollingTimeout };
|
||||
var endpoint = $"http://localhost:{_port}/sse";
|
||||
var deadline = DateTime.UtcNow.AddSeconds(30);
|
||||
|
||||
|
|
@ -72,7 +73,7 @@ public class EverythingSseServerFixture : IAsyncDisposable
|
|||
|
||||
using var stopProcess = Process.Start(stopInfo)
|
||||
?? throw new InvalidOperationException($"Could not stop process for {stopInfo.FileName} with '{stopInfo.Arguments}'.");
|
||||
await stopProcess.WaitForExitAsync(TimeSpan.FromSeconds(10));
|
||||
await stopProcess.WaitForExitAsync(TestConstants.DefaultTimeout);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue