Skip to content

Commit

Permalink
Add support for environment timeout multiplier in remote operation (#…
Browse files Browse the repository at this point in the history
…15215)

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
  • Loading branch information
yurai007 and jkotas authored Nov 5, 2024
1 parent 78eb939 commit d341d10
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/Microsoft.DotNet.RemoteExecutor/src/RemoteExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ namespace Microsoft.DotNet.RemoteExecutor
{
public static partial class RemoteExecutor
{
/// <summary>
/// A timeout (milliseconds) after which a wait on a remote operation should be considered a failure.
/// </summary>
public const int FailWaitTimeoutMilliseconds = 60 * 1000;

/// <summary>
/// The exit code returned when the test process exits successfully.
/// </summary>
Expand Down Expand Up @@ -99,6 +94,18 @@ static RemoteExecutor()
private static bool IsNetCore() =>
Environment.Version.Major >= 5 || RuntimeInformation.FrameworkDescription.StartsWith(".NET Core", StringComparison.OrdinalIgnoreCase);

/// <summary>
/// A timeout (milliseconds) after which a wait on a remote operation should be considered a failure.
/// </summary>
public static int FailWaitTimeoutMilliseconds
{
get
{
int.TryParse(Environment.GetEnvironmentVariable("DOTNET_TEST_TIMEOUT_MULTIPLIER"), out int failWaitTimeoutMultiplier);
return 60 * 1000 * Math.Max(failWaitTimeoutMultiplier, 1);
}
}

/// <summary>Returns true if the RemoteExecutor works on the current platform, otherwise false.</summary>
public static bool IsSupported { get; } =
!RuntimeInformation.IsOSPlatform(OSPlatform.Create("IOS")) &&
Expand Down

0 comments on commit d341d10

Please sign in to comment.