Wait for elasticsearch exit in packaging tests (#47242)

The archives stopElasticsearch utility method sends SIGTERM to the
elasticsearch process, but does not wait for it to exit. That can cause
subsequent tests to sometimes file. This commit adds wait logic to both
linux and windows for the stopElasticsearch method.

closes #44501
This commit is contained in:
Ryan Ernst 2019-09-30 02:04:57 -07:00 committed by Alpar Torok
parent 33ebf5f5dc
commit b270f70be1
1 changed files with 2 additions and 2 deletions

View File

@ -315,8 +315,8 @@ public class Archives {
assertThat(pid, not(isEmptyOrNullString()));
final Shell sh = new Shell();
Platforms.onLinux(() -> sh.run("kill -SIGTERM " + pid));
Platforms.onWindows(() -> sh.run("Get-Process -Id " + pid + " | Stop-Process -Force"));
Platforms.onLinux(() -> sh.run("kill -SIGTERM " + pid + "; tail --pid=" + pid + " -f /dev/null"));
Platforms.onWindows(() -> sh.run("Get-Process -Id " + pid + " | Stop-Process -Force; Wait-Process -Id " + pid));
}
}