Skip to content

Commit

Permalink
[QUIC] Fix failing parallel tests (#83687)
Browse files Browse the repository at this point in the history
* Hocus pocus

* Enable failing test

* Fixed touching msquic when it's not supported.

* Feedback

* Test of output

* Feedback
  • Loading branch information
ManickaP authored Mar 24, 2023
1 parent dce3439 commit dae6c24
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using Microsoft.Quic;

using static Microsoft.Quic.MsQuic;

#if TARGET_WINDOWS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public async Task SupportedLinuxPlatformsWithMsQuic_IsSupportedIsTrue()
find.StartInfo.FileName = "find";
find.StartInfo.Arguments = "/usr/ -iname libmsquic.so*";
find.StartInfo.RedirectStandardOutput = true;
find.StartInfo.RedirectStandardError = true;
find.Start();
string output = await find.StandardOutput.ReadToEndAsync();
_output.WriteLine(output);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ public Task Listener_BacklogLimitRefusesConnection_ParallelClients_ClientThrows(
[InlineData(100, 101)]
[InlineData(15, 100)]
[InlineData(10, 1_000)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/82769", typeof(PlatformDetection), nameof(PlatformDetection.IsArmOrArm64Process))]
[OuterLoop("Higher number of connections slow the test down.")]
private Task Listener_BacklogLimitRefusesConnection_ParallelClients_ClientThrows_Slow(int backlogLimit, int connectCount)
=> Listener_BacklogLimitRefusesConnection_ParallelClients_ClientThrows_Core(backlogLimit, connectCount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
using Xunit.Abstractions;
using System.Diagnostics.Tracing;
using System.Net.Sockets;
using Microsoft.Quic;
using static Microsoft.Quic.MsQuic;

namespace System.Net.Quic.Tests
{
Expand Down Expand Up @@ -40,10 +42,25 @@ public abstract class QuicTestBase : IDisposable
public const int PassingTestTimeoutMilliseconds = 4 * 60 * 1000;
public static TimeSpan PassingTestTimeout => TimeSpan.FromMilliseconds(PassingTestTimeoutMilliseconds);

public QuicTestBase(ITestOutputHelper output)
static unsafe QuicTestBase()
{
Console.WriteLine($"MsQuic {(IsSupported ? "supported" : "not supported")} and using '{MsQuicApi.MsQuicLibraryVersion}'.");

if (IsSupported)
{
QUIC_SETTINGS settings = default(QUIC_SETTINGS);
settings.IsSet.MaxWorkerQueueDelayUs = 1;
settings.MaxWorkerQueueDelayUs = 2_500_000u; // 2.5s, 10x the default
if (StatusFailed(MsQuicApi.Api.ApiTable->SetParam(null, QUIC_PARAM_GLOBAL_SETTINGS, (uint)sizeof(QUIC_SETTINGS), (byte*)&settings)))
{
Console.WriteLine($"Unable to set MsQuic MaxWorkerQueueDelayUs.");
}
}
}

public unsafe QuicTestBase(ITestOutputHelper output)
{
_output = output;
_output.WriteLine($"Using {MsQuicApi.MsQuicLibraryVersion}");
}

public void Dispose()
Expand Down

0 comments on commit dae6c24

Please sign in to comment.