diff --git a/test/Squirrel.Packaging.Tests/WindowsPackTests.cs b/test/Squirrel.Packaging.Tests/WindowsPackTests.cs index af38912fe..54f0fba8c 100644 --- a/test/Squirrel.Packaging.Tests/WindowsPackTests.cs +++ b/test/Squirrel.Packaging.Tests/WindowsPackTests.cs @@ -405,9 +405,6 @@ private string RunImpl(ProcessStartInfo psi, ILogger logger, int? exitCode = 0) logger.Info($"TEST: Process exited with code {p.ExitCode} in {elapsed.TotalSeconds}s"); - if (exitCode != null) - Assert.Equal(exitCode, p.ExitCode); - using var fs = Utility.Retry(() => { return File.Open(outputfile, FileMode.Open, FileAccess.ReadWrite, FileShare.None); }, 10, 1000, logger); @@ -421,6 +418,10 @@ private string RunImpl(ProcessStartInfo psi, ILogger logger, int? exitCode = 0) logger.Info($"TEST: Process output: {Environment.NewLine}{output.Trim()}{Environment.NewLine}"); } + if (exitCode.HasValue && p.ExitCode != exitCode.Value) { + throw new Exception($"Process exited with code {p.ExitCode} but expected {exitCode.Value}"); + } + return String.Join(Environment.NewLine, output .Split('\n')