Skip to content

Commit 9e8c531

Browse files
committed
Address comment
1 parent 2541491 commit 9e8c531

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

server/src/test/java/org/elasticsearch/indices/settings/UpdateSettingsIT.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertThrows;
4949
import static org.hamcrest.Matchers.containsString;
5050
import static org.hamcrest.Matchers.equalTo;
51+
import static org.hamcrest.Matchers.greaterThan;
5152
import static org.hamcrest.Matchers.nullValue;
5253

5354
public class UpdateSettingsIT extends ESIntegTestCase {
@@ -446,7 +447,7 @@ public void testOpenCloseUpdateSettings() throws Exception {
446447
assertThat(getSettingsResponse.getSetting("test", "index.final"), nullValue());
447448
}
448449

449-
public void testEngineGCDeletesSetting() {
450+
public void testEngineGCDeletesSetting() throws Exception {
450451
createIndex("test");
451452
client().prepareIndex("test", "type", "1").setSource("f", 1).get();
452453
DeleteResponse response = client().prepareDelete("test", "type", "1").get();
@@ -462,10 +463,7 @@ public void testEngineGCDeletesSetting() {
462463
// Make sure the time has advanced for InternalEngine#resolveDocVersion()
463464
for (ThreadPool tPool : internalCluster().getInstances(ThreadPool.class)) {
464465
long time1 = tPool.relativeTimeInMillis();
465-
long time2 = tPool.relativeTimeInMillis();
466-
while (time1 == time2) {
467-
time2 = tPool.relativeTimeInMillis();
468-
}
466+
assertBusy(() -> assertThat(tPool.relativeTimeInMillis(), greaterThan(time1)));
469467
}
470468

471469
// delete is should not be in cache

0 commit comments

Comments
 (0)