Browse Source

Fix translog stats on closed indices yaml test (#52800)

We need to wait for no initializing shards before closing; otherwise, 
we might fail to close some recovering replicas.

Closes #52701
Nhat Nguyen 5 years ago
parent
commit
827f62c990

+ 4 - 0
rest-api-spec/src/main/resources/rest-api-spec/test/indices.stats/20_translog.yml

@@ -107,6 +107,10 @@
         metric: [ translog ]
   - match: { indices.test.primaries.translog.operations: 1 }
   - match: { indices.test.primaries.translog.uncommitted_operations: 1 }
+  - do:
+      cluster.health:
+        wait_for_no_initializing_shards: true
+        wait_for_events: languid
   - do:
       indices.close:
         index: test