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:
parent
33ebf5f5dc
commit
b270f70be1
|
@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue