Skip to content

Commit 0de7464

Browse files
committed
Fix testTurnOffTranslogRetentionAfterAllShardStarted
We turn off the translog retention policy asynchronously using the generic threadpool; hence, we need to assert busily here Relates #49448
1 parent b9fbc8d commit 0de7464

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

server/src/test/java/org/elasticsearch/index/replication/RetentionLeasesReplicationTests.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,12 @@ public void testTurnOffTranslogRetentionAfterAllShardStarted() throws Exception
163163
}
164164
group.syncGlobalCheckpoint();
165165
group.flush();
166-
for (IndexShard shard : group) {
167-
assertThat(shard.translogStats().estimatedNumberOfOperations(), equalTo(0));
168-
}
166+
assertBusy(() -> {
167+
// we turn off the translog retention policy using the generic threadPool
168+
for (IndexShard shard : group) {
169+
assertThat(shard.translogStats().estimatedNumberOfOperations(), equalTo(0));
170+
}
171+
});
169172
}
170173
}
171174

0 commit comments

Comments
 (0)