diff --git a/test/Velopack.Packaging.Tests/WindowsPackTests.cs b/test/Velopack.Packaging.Tests/WindowsPackTests.cs index 1620f22d..7cc2fd25 100644 --- a/test/Velopack.Packaging.Tests/WindowsPackTests.cs +++ b/test/Velopack.Packaging.Tests/WindowsPackTests.cs @@ -531,7 +531,8 @@ public class WindowsPackTests Thread.Sleep(5000); // update.exe runs in a separate process here - logger.Info("Velopack.log:" + Environment.NewLine + File.ReadAllText(Path.Combine(rootDir, "Velopack.log"))); + string logContents = ReadFileWithRetry(Path.Combine(rootDir, "Velopack.log"), logger); + logger.Info("Velopack.log:" + Environment.NewLine + logContents); logger.Info("TEST: " + DateTime.Now.ToLongTimeString()); if (origDirName != "current") { @@ -553,6 +554,13 @@ public class WindowsPackTests Assert.EndsWith(Environment.NewLine + "2.0.0", chk3version); } + private static string ReadFileWithRetry(string path, ILogger logger) + { + return IoUtil.Retry(() => { + return File.ReadAllText(path); + }, logger: logger); + } + //private string RunCoveredRust(string binName, string[] args, string workingDir, ILogger logger, int? exitCode = 0) //{ // var outputFile = GetPath($"coverage.runrust.{RandomString(8)}.xml");