39
39
import org .elasticsearch .indices .breaker .NoneCircuitBreakerService ;
40
40
import org .elasticsearch .node .Node ;
41
41
import org .elasticsearch .test .ESTestCase ;
42
+ import org .elasticsearch .test .junit .annotations .TestIssueLogging ;
42
43
import org .elasticsearch .threadpool .TestThreadPool ;
43
44
import org .elasticsearch .threadpool .ThreadPool ;
44
45
import org .elasticsearch .transport .TransportService ;
@@ -374,6 +375,7 @@ public void testStatePersistedOnLoad() throws IOException {
374
375
}
375
376
}
376
377
378
+ @ TestIssueLogging (value = "org.elasticsearch.gateway:TRACE" , issueUrl = "https://github.com/elastic/elasticsearch/issues/87952" )
377
379
public void testDataOnlyNodePersistence () throws Exception {
378
380
final List <Closeable > cleanup = new ArrayList <>(2 );
379
381
@@ -431,7 +433,7 @@ public void testDataOnlyNodePersistence() throws Exception {
431
433
);
432
434
persistedState .setCurrentTerm (state .term ());
433
435
persistedState .setLastAcceptedState (state );
434
- assertBusy (() -> assertTrue (gateway .allPendingAsyncStatesWritten ()));
436
+ assertBusy (() -> assertTrue (gateway .allPendingAsyncStatesWritten ()), 30 , TimeUnit . SECONDS );
435
437
436
438
assertThat (
437
439
persistedState .getLastAcceptedState ().getLastAcceptedConfiguration (),
@@ -449,7 +451,7 @@ public void testDataOnlyNodePersistence() throws Exception {
449
451
);
450
452
451
453
persistedState .markLastAcceptedStateAsCommitted ();
452
- assertBusy (() -> assertTrue (gateway .allPendingAsyncStatesWritten ()));
454
+ assertBusy (() -> assertTrue (gateway .allPendingAsyncStatesWritten ()), 30 , TimeUnit . SECONDS );
453
455
454
456
CoordinationMetadata expectedCoordinationMetadata = CoordinationMetadata .builder (coordinationMetadata )
455
457
.lastCommittedConfiguration (coordinationMetadata .getLastAcceptedConfiguration ())
@@ -503,7 +505,7 @@ public void testDataOnlyNodePersistence() throws Exception {
503
505
assertTrue (wroteState ); // must write it at least once
504
506
assertEquals (currentTerm , persistedState .getCurrentTerm ());
505
507
assertClusterStateEqual (state , persistedState .getLastAcceptedState ());
506
- assertBusy (() -> assertTrue (gateway .allPendingAsyncStatesWritten ()));
508
+ assertBusy (() -> assertTrue (gateway .allPendingAsyncStatesWritten ()), 30 , TimeUnit . SECONDS );
507
509
508
510
gateway .close ();
509
511
assertTrue (cleanup .remove (gateway ));
0 commit comments