Skip to content

Commit 9ae0d12

Browse files
committed
Make timeout configurable
1 parent 9aab932 commit 9ae0d12

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/common/DotNet.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,14 @@ public static ExecutionResult Execute (string verb, string project, Dictionary<s
262262
env ["MSBuildSDKsPath"] = null;
263263
env ["MSBUILD_EXE_PATH"] = null;
264264
var output = new StringBuilder ();
265-
timeout ??= TimeSpan.FromMinutes (10);
265+
if (timeout is null) {
266+
var timeoutVar = Environment.GetEnvironmentVariable ("TIMEOUT_IN_MINUTES");
267+
if (int.TryParse (timeoutVar, out var timeoutValue)) {
268+
timeout = TimeSpan.FromMinutes (timeoutValue);
269+
} else {
270+
timeout = TimeSpan.FromMinutes (10);
271+
}
272+
}
266273
var rv = Execution.RunWithStringBuildersAsync (Executable, args, env, output, output, Console.Out, workingDirectory: Path.GetDirectoryName (project), timeout: timeout).Result;
267274
if (assert_success && rv.ExitCode != 0) {
268275
var outputStr = output.ToString ();

0 commit comments

Comments
 (0)