Skip to content

Commit

Permalink
Add timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
kayoub5 committed Jan 3, 2024
1 parent 63cddca commit e1961ff
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Test/TestUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);

Check failure on line 65 in Test/TestUser.cs

View workflow job for this annotation

GitHub Actions / build

'Assert' does not contain a definition for 'AreEqual'
}

Expand Down

0 comments on commit e1961ff

Please sign in to comment.