Skip to content

Commit

Permalink
Make timeout configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfbjarne committed Feb 14, 2025
1 parent 9aab932 commit 9ae0d12
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/common/DotNet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,14 @@ public static ExecutionResult Execute (string verb, string project, Dictionary<s
env ["MSBuildSDKsPath"] = null;
env ["MSBUILD_EXE_PATH"] = null;
var output = new StringBuilder ();
timeout ??= TimeSpan.FromMinutes (10);
if (timeout is null) {
var timeoutVar = Environment.GetEnvironmentVariable ("TIMEOUT_IN_MINUTES");
if (int.TryParse (timeoutVar, out var timeoutValue)) {
timeout = TimeSpan.FromMinutes (timeoutValue);
} else {
timeout = TimeSpan.FromMinutes (10);
}
}
var rv = Execution.RunWithStringBuildersAsync (Executable, args, env, output, output, Console.Out, workingDirectory: Path.GetDirectoryName (project), timeout: timeout).Result;
if (assert_success && rv.ExitCode != 0) {
var outputStr = output.ToString ();
Expand Down

0 comments on commit 9ae0d12

Please sign in to comment.