Skip to content

Commit

Permalink
[TEST] Wait for CS to be fully applied in testDeleteCreateInOneBulk
Browse files Browse the repository at this point in the history
The test has an issue that exhibits only super rarely. The test sets the publish
timeout to 0, then proceeds to block cluster state processing on a data node,
then deletes an index and recreates it, and finally removes the cluster state
processing block. Finally, it calls ensureGreen, which might now return before
the data node has fully applied the cluster state that removed and readded the
shard, due to the publish timeout of 0. This commit waits for the cluster state
to be fully processed on the data node before doing the search.

Closes #30718
  • Loading branch information
ywelsch committed May 22, 2018
1 parent af8ad8d commit e6a784c
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ public void testDeleteCreateInOneBulk() throws Exception {
logger.info("--> letting cluster proceed");
disruption.stopDisrupting();
ensureGreen(TimeValue.timeValueMinutes(30), "test");
// due to publish_timeout of 0, wait for data node to have cluster state fully applied
assertBusy(() -> {
long masterClusterStateVersion = internalCluster().clusterService(internalCluster().getMasterName()).state().version();
long dataClusterStateVersion = internalCluster().clusterService(dataNode).state().version();
assertThat(masterClusterStateVersion, equalTo(dataClusterStateVersion));
});
assertHitCount(client().prepareSearch("test").get(), 0);
}

Expand Down

0 comments on commit e6a784c

Please sign in to comment.