3939import org .elasticsearch .env .TestEnvironment ;
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 ;
@@ -378,6 +379,7 @@ public void testStatePersistedOnLoad() throws IOException {
378379 }
379380 }
380381
382+ @ TestIssueLogging (value = "org.elasticsearch.gateway:TRACE" , issueUrl = "https://github.com/elastic/elasticsearch/issues/87952" )
381383 public void testDataOnlyNodePersistence () throws Exception {
382384 final List <Closeable > cleanup = new ArrayList <>(2 );
383385
@@ -434,7 +436,7 @@ public void testDataOnlyNodePersistence() throws Exception {
434436 );
435437 persistedState .setCurrentTerm (state .term ());
436438 persistedState .setLastAcceptedState (state );
437- assertBusy (() -> assertTrue (gateway .allPendingAsyncStatesWritten ()));
439+ assertBusy (() -> assertTrue (gateway .allPendingAsyncStatesWritten ()), 30 , TimeUnit . SECONDS );
438440
439441 assertThat (
440442 persistedState .getLastAcceptedState ().getLastAcceptedConfiguration (),
@@ -452,7 +454,7 @@ public void testDataOnlyNodePersistence() throws Exception {
452454 );
453455
454456 persistedState .markLastAcceptedStateAsCommitted ();
455- assertBusy (() -> assertTrue (gateway .allPendingAsyncStatesWritten ()));
457+ assertBusy (() -> assertTrue (gateway .allPendingAsyncStatesWritten ()), 30 , TimeUnit . SECONDS );
456458
457459 CoordinationMetadata expectedCoordinationMetadata = CoordinationMetadata .builder (coordinationMetadata )
458460 .lastCommittedConfiguration (coordinationMetadata .getLastAcceptedConfiguration ())
@@ -506,7 +508,7 @@ public void testDataOnlyNodePersistence() throws Exception {
506508 assertTrue (wroteState ); // must write it at least once
507509 assertEquals (currentTerm , persistedState .getCurrentTerm ());
508510 assertClusterStateEqual (state , persistedState .getLastAcceptedState ());
509- assertBusy (() -> assertTrue (gateway .allPendingAsyncStatesWritten ()));
511+ assertBusy (() -> assertTrue (gateway .allPendingAsyncStatesWritten ()), 30 , TimeUnit . SECONDS );
510512
511513 gateway .close ();
512514 assertTrue (cleanup .remove (gateway ));
0 commit comments