3939import org .elasticsearch .indices .breaker .NoneCircuitBreakerService ;
4040import org .elasticsearch .node .Node ;
4141import org .elasticsearch .test .ESTestCase ;
42+ import org .elasticsearch .test .junit .annotations .TestIssueLogging ;
4243import org .elasticsearch .threadpool .TestThreadPool ;
4344import org .elasticsearch .threadpool .ThreadPool ;
4445import org .elasticsearch .transport .TransportService ;
@@ -374,6 +375,7 @@ public void testStatePersistedOnLoad() throws IOException {
374375 }
375376 }
376377
378+ @ TestIssueLogging (value = "org.elasticsearch.gateway:TRACE" , issueUrl = "https://github.com/elastic/elasticsearch/issues/87952" )
377379 public void testDataOnlyNodePersistence () throws Exception {
378380 final List <Closeable > cleanup = new ArrayList <>(2 );
379381
@@ -431,7 +433,7 @@ public void testDataOnlyNodePersistence() throws Exception {
431433 );
432434 persistedState .setCurrentTerm (state .term ());
433435 persistedState .setLastAcceptedState (state );
434- assertBusy (() -> assertTrue (gateway .allPendingAsyncStatesWritten ()));
436+ assertBusy (() -> assertTrue (gateway .allPendingAsyncStatesWritten ()), 30 , TimeUnit . SECONDS );
435437
436438 assertThat (
437439 persistedState .getLastAcceptedState ().getLastAcceptedConfiguration (),
@@ -449,7 +451,7 @@ public void testDataOnlyNodePersistence() throws Exception {
449451 );
450452
451453 persistedState .markLastAcceptedStateAsCommitted ();
452- assertBusy (() -> assertTrue (gateway .allPendingAsyncStatesWritten ()));
454+ assertBusy (() -> assertTrue (gateway .allPendingAsyncStatesWritten ()), 30 , TimeUnit . SECONDS );
453455
454456 CoordinationMetadata expectedCoordinationMetadata = CoordinationMetadata .builder (coordinationMetadata )
455457 .lastCommittedConfiguration (coordinationMetadata .getLastAcceptedConfiguration ())
@@ -503,7 +505,7 @@ public void testDataOnlyNodePersistence() throws Exception {
503505 assertTrue (wroteState ); // must write it at least once
504506 assertEquals (currentTerm , persistedState .getCurrentTerm ());
505507 assertClusterStateEqual (state , persistedState .getLastAcceptedState ());
506- assertBusy (() -> assertTrue (gateway .allPendingAsyncStatesWritten ()));
508+ assertBusy (() -> assertTrue (gateway .allPendingAsyncStatesWritten ()), 30 , TimeUnit . SECONDS );
507509
508510 gateway .close ();
509511 assertTrue (cleanup .remove (gateway ));
0 commit comments