[CSharp] Add a retry if we get SIGILL when running dotnet.

Issue #2078 is a crash (SIGILL) inside the dotnet runtime when running on
macOS on Travis.  This is intermittent, so a retry may help.  Retry this
specific exit status inside runProcess.
This commit is contained in:
Ewan Mellor 2017-11-14 13:33:01 -08:00
parent 84eca87da2
commit 22337f35c0
No known key found for this signature in database
GPG Key ID: 7CE1C6BC9EC8645D
1 changed files with 18 additions and 0 deletions

View File

@ -548,6 +548,10 @@ public class BaseCSharpTest implements RuntimeTestSupport /*, SpecialRuntimeTest
}
private boolean runProcess(String[] args, String path) throws Exception {
return runProcess(args, path, 0);
}
private boolean runProcess(String[] args, String path, int retries) throws Exception {
ProcessBuilder pb = new ProcessBuilder(args);
pb.directory(new File(path));
Process process = pb.start();
@ -567,6 +571,20 @@ public class BaseCSharpTest implements RuntimeTestSupport /*, SpecialRuntimeTest
System.err.println("runProcess stdoutVacuum: " + stdoutVacuum.toString());
System.err.println("runProcess stderrVacuum: " + stderrDuringParse);
}
if (exitValue == 132) {
// Retry after SIGILL. We are seeing this intermittently on
// macOS (issue #2078).
if (retries < 3) {
System.err.println("runProcess retrying; " + retries +
" retries so far");
return runProcess(args, path, retries + 1);
}
else {
System.err.println("runProcess giving up after " + retries +
" retries");
return false;
}
}
return success;
}