Wait for ES in Docker to start before checking files (#60825)

Closes #54817.
This commit is contained in:
Rory Hunter 2020-08-07 14:19:34 +01:00 committed by Rory Hunter
parent 8e9f8ba420
commit 5c76978e80
1 changed files with 5 additions and 1 deletions

View File

@ -476,7 +476,11 @@ public class DockerTests extends PackagingTestCase {
/**
* Check that there are no files with a GID other than 0.
*/
public void test101AllFilesAreGroupZero() {
public void test101AllFilesAreGroupZero() throws Exception {
// We wait for Elasticsearch to finish starting up in order to avoid the situation where `find` traverses the filesystem
// and sees files in a directory listing, which have disappeared by the time `find` tries to examine them. This periodically
// happened with the keystore, for example.
waitForElasticsearch(installation);
final String findResults = sh.run("find . -not -gid 0").stdout;
assertThat("Found some files whose GID != 0", findResults, is(emptyString()));