Skip to content

Commit

Permalink
Fix ClusterHealthIT.testHealthOnMasterFailover (elastic#54170) (elast…
Browse files Browse the repository at this point in the history
…ic#54177)

We can run into a state where there's no more events to wait for temporarily
but the cluster still isn't green. I added the wait for green flag to the request
so the assertion for green cluster health below doesn't fail.

Closes elastic#53457
  • Loading branch information
original-brownbear authored Mar 25, 2020
1 parent 16e4bd5 commit 32fa90c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ public void testHealthOnMasterFailover() throws Exception {
// Run a few health requests concurrent to master fail-overs against a data-node to make sure master failover is handled
// without exceptions
for (int i = 0; i < 20; ++i) {
responseFutures.add(client(node).admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).execute());
responseFutures.add(client(node).admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID)
.setWaitForGreenStatus().execute());
internalCluster().restartNode(internalCluster().getMasterName(), InternalTestCluster.EMPTY_CALLBACK);
}
for (ActionFuture<ClusterHealthResponse> responseFuture : responseFutures) {
Expand Down

0 comments on commit 32fa90c

Please sign in to comment.