Skip to content

Commit

Permalink
[7.17] Make docker packaging test more resilient (#111205) (#111209)
Browse files Browse the repository at this point in the history
* Make docker packaging test more resilient (#111205)

Wrap check for container shutdown log message in an `assertBusy()` to
deal with race conditions.

Closes #111132
# Conflicts:
#	muted-tests.yml
#	qa/os/src/test/java/org/elasticsearch/packaging/test/DockerTests.java

* Fix compile issue
  • Loading branch information
mark-vieira authored Jul 23, 2024
1 parent 0d3f9b7 commit 61d7646
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1108,10 +1108,12 @@ public void test600Interrupt() throws Exception {
int maxPid = processes.stream().map(i -> Integer.parseInt(i.trim())).max(Integer::compareTo).get();

sh.run("bash -c 'kill -int " + maxPid + "'"); // send ctrl+c to all java processes
final Result containerLogsAfter = getContainerLogs();

assertThat("Container logs should contain stopping ...", containerLogsAfter.stdout, containsString("stopping ..."));
assertThat("No errors stdout", containerLogsAfter.stdout, not(containsString("java.security.AccessControlException:")));
assertThat("No errors stderr", containerLogsAfter.stderr, not(containsString("java.security.AccessControlException:")));
assertBusy(() -> {
final Result containerLogsAfter = getContainerLogs();
assertThat("Container logs should contain stopping ...", containerLogsAfter.stdout, containsString("stopping ..."));
assertThat("No errors stdout", containerLogsAfter.stdout, not(containsString("java.security.AccessControlException:")));
assertThat("No errors stderr", containerLogsAfter.stderr, not(containsString("java.security.AccessControlException:")));
});
}
}

0 comments on commit 61d7646

Please sign in to comment.