diff --git a/Test/TestUser.cs b/Test/TestUser.cs index f24d3cac..ded22d92 100644 --- a/Test/TestUser.cs +++ b/Test/TestUser.cs @@ -42,10 +42,11 @@ public static bool Create() private static void Bash(string cmd, params string[] args) { + var arguments = string.Join(" ", args); var info = new ProcessStartInfo { FileName = cmd, - Arguments = string.Join(" ", args), + Arguments = arguments, UseShellExecute = false, RedirectStandardOutput = true, RedirectStandardError = true @@ -57,7 +58,10 @@ private static void Bash(string cmd, params string[] args) process.BeginOutputReadLine(); process.BeginErrorReadLine(); - process.WaitForExit(); + if (!process.WaitForExit(10000)) + { + throw new TimeoutException($"Command '{cmd} {arguments}' timed out"); + } Assert.AreEqual(process.ExitCode, 0); }