Skip to content

Commit d341d10

Browse files
yurai007jkotas
andauthored
Add support for environment timeout multiplier in remote operation (#15215)
Co-authored-by: Jan Kotas <[email protected]>
1 parent 78eb939 commit d341d10

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/Microsoft.DotNet.RemoteExecutor/src/RemoteExecutor.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ namespace Microsoft.DotNet.RemoteExecutor
1515
{
1616
public static partial class RemoteExecutor
1717
{
18-
/// <summary>
19-
/// A timeout (milliseconds) after which a wait on a remote operation should be considered a failure.
20-
/// </summary>
21-
public const int FailWaitTimeoutMilliseconds = 60 * 1000;
22-
2318
/// <summary>
2419
/// The exit code returned when the test process exits successfully.
2520
/// </summary>
@@ -99,6 +94,18 @@ static RemoteExecutor()
9994
private static bool IsNetCore() =>
10095
Environment.Version.Major >= 5 || RuntimeInformation.FrameworkDescription.StartsWith(".NET Core", StringComparison.OrdinalIgnoreCase);
10196

97+
/// <summary>
98+
/// A timeout (milliseconds) after which a wait on a remote operation should be considered a failure.
99+
/// </summary>
100+
public static int FailWaitTimeoutMilliseconds
101+
{
102+
get
103+
{
104+
int.TryParse(Environment.GetEnvironmentVariable("DOTNET_TEST_TIMEOUT_MULTIPLIER"), out int failWaitTimeoutMultiplier);
105+
return 60 * 1000 * Math.Max(failWaitTimeoutMultiplier, 1);
106+
}
107+
}
108+
102109
/// <summary>Returns true if the RemoteExecutor works on the current platform, otherwise false.</summary>
103110
public static bool IsSupported { get; } =
104111
!RuntimeInformation.IsOSPlatform(OSPlatform.Create("IOS")) &&

0 commit comments

Comments
 (0)