[TEST] Wait for CS to be fully applied in testDeleteCreateInOneBulk

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
This commit is contained in:
Yannick Welsch 2018-05-22 13:28:55 +02:00
parent af8ad8d172
commit e6a784c474
1 changed files with 6 additions and 0 deletions

View File

@ -181,6 +181,12 @@ public class RareClusterStateIT extends ESIntegTestCase {
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);
}