48
48
import static org .elasticsearch .test .hamcrest .ElasticsearchAssertions .assertThrows ;
49
49
import static org .hamcrest .Matchers .containsString ;
50
50
import static org .hamcrest .Matchers .equalTo ;
51
+ import static org .hamcrest .Matchers .greaterThan ;
51
52
import static org .hamcrest .Matchers .nullValue ;
52
53
53
54
public class UpdateSettingsIT extends ESIntegTestCase {
@@ -446,7 +447,7 @@ public void testOpenCloseUpdateSettings() throws Exception {
446
447
assertThat (getSettingsResponse .getSetting ("test" , "index.final" ), nullValue ());
447
448
}
448
449
449
- public void testEngineGCDeletesSetting () {
450
+ public void testEngineGCDeletesSetting () throws Exception {
450
451
createIndex ("test" );
451
452
client ().prepareIndex ("test" , "type" , "1" ).setSource ("f" , 1 ).get ();
452
453
DeleteResponse response = client ().prepareDelete ("test" , "type" , "1" ).get ();
@@ -462,10 +463,7 @@ public void testEngineGCDeletesSetting() {
462
463
// Make sure the time has advanced for InternalEngine#resolveDocVersion()
463
464
for (ThreadPool tPool : internalCluster ().getInstances (ThreadPool .class )) {
464
465
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 )));
469
467
}
470
468
471
469
// delete is should not be in cache
0 commit comments