mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Add retry to make test more resilient.
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user