File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -69,15 +69,19 @@ public static void main(String args[]) throws Exception {
6969 protected boolean allowedExitValue (int exitValue ) {
7070 if (passName .equals ("Kill" )) {
7171 // 143 is SIGTERM, which we expect to get when doing a Process.destroy(),
72- // unless we are on Windows, which will exit with a 1.
72+ // unless we are on Windows, which will exit with a 1. However, sometimes
73+ // there is a race and the main thread exits before SIGTERM can force
74+ // an exit(143), so we need to allow exitValue 0 also.
7375 if (!Platform .isWindows ()) {
74- return exitValue == 143 ;
76+ return exitValue == 143 || exitValue == 0 ;
7577 } else {
76- return exitValue == 1 ;
78+ return exitValue == 1 || exitValue == 0 ;
7779 }
7880 } else if (passName .equals ("exit()" )) {
7981 // This version of the test does an exit(1), so that's what we expect.
80- return exitValue == 1 ;
82+ // But similar to the SIGTERM race issue, the exit(1) might not happen
83+ // before the main thread exits, so we need to expect 0 also.
84+ return exitValue == 1 || exitValue == 0 ;
8185 }
8286 return super .allowedExitValue (exitValue );
8387 }
You can’t perform that action at this time.
0 commit comments