1
0
Эх сурвалжийг харах

[TEST] testAckedIndexing waits for the cluster state to have propogated
to all nodes in the cluster before checking the existance of documents
on each node

Ali Beyad 8 жил өмнө
parent
commit
ce811feba7

+ 10 - 0
core/src/test/java/org/elasticsearch/discovery/DiscoveryWithServiceDisruptionsIT.java

@@ -584,6 +584,16 @@ public class DiscoveryWithServiceDisruptionsIT extends ESIntegTestCase {
                 }
                 ensureGreen("test");
 
+                // make sure all nodes have the updated cluster state with the latest routing table
+                final long clusterStateVersionOnMaster = internalCluster().clusterService(internalCluster().getMasterName())
+                                                             .state().getVersion();
+                assertBusy(() -> {
+                    for (String node : nodes) {
+                        assertThat(internalCluster().clusterService(node).state().getVersion(),
+                            greaterThanOrEqualTo(clusterStateVersionOnMaster));
+                    }
+                });
+
                 logger.info("validating successful docs");
                 for (String node : nodes) {
                     try {