Enable netfx testing. (#588)
* Enable netfx testing. * Skip impacted tests and re-enable netfx testing. * Remove redundant comment. * Remove unnecessary project configuration. * Simplify test server copying.
This commit is contained in:
parent
c0440760ac
commit
aa75f6f37e
1 changed files with 1940 additions and 53 deletions
|
|
@ -9,7 +9,7 @@ namespace ModelContextProtocol.Tests;
|
|||
|
||||
public class StdioServerIntegrationTests(ITestOutputHelper testOutputHelper) : LoggedTest(testOutputHelper)
|
||||
{
|
||||
public static bool CanSendSigInt { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
|
||||
public static bool CanSendSigInt { get; } = (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) && !PlatformDetection.IsMonoRuntime;
|
||||
private const int SIGINT = 2;
|
||||
|
||||
[Fact(Skip = "Platform not supported by this test.", SkipUnless = nameof(CanSendSigInt))]
|
||||
|
|
@ -46,9 +46,7 @@ public class StdioServerIntegrationTests(ITestOutputHelper testOutputHelper) : L
|
|||
// https://github.com/dotnet/runtime/issues/109432, https://github.com/dotnet/runtime/issues/44944
|
||||
Assert.Equal(0, kill(process.Id, SIGINT));
|
||||
|
||||
using var shutdownCts = CancellationTokenSource.CreateLinkedTokenSource(TestContext.Current.CancellationToken);
|
||||
shutdownCts.CancelAfter(TimeSpan.FromSeconds(10));
|
||||
await process.WaitForExitAsync(shutdownCts.Token);
|
||||
await process.WaitForExitAsync(TimeSpan.FromSeconds(10));
|
||||
|
||||
Assert.True(process.HasExited);
|
||||
Assert.Equal(0, process.ExitCode);
|
||||
|
|
|
|||
Loading…
Reference in a new issue