39
39
import org .elasticsearch .env .TestEnvironment ;
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 ;
@@ -378,6 +379,7 @@ public void testStatePersistedOnLoad() throws IOException {
378
379
}
379
380
}
380
381
382
+ @ TestIssueLogging (value = "org.elasticsearch.gateway:TRACE" , issueUrl = "https://github.com/elastic/elasticsearch/issues/87952" )
381
383
public void testDataOnlyNodePersistence () throws Exception {
382
384
final List <Closeable > cleanup = new ArrayList <>(2 );
383
385
@@ -434,7 +436,7 @@ public void testDataOnlyNodePersistence() throws Exception {
434
436
);
435
437
persistedState .setCurrentTerm (state .term ());
436
438
persistedState .setLastAcceptedState (state );
437
- assertBusy (() -> assertTrue (gateway .allPendingAsyncStatesWritten ()));
439
+ assertBusy (() -> assertTrue (gateway .allPendingAsyncStatesWritten ()), 30 , TimeUnit . SECONDS );
438
440
439
441
assertThat (
440
442
persistedState .getLastAcceptedState ().getLastAcceptedConfiguration (),
@@ -452,7 +454,7 @@ public void testDataOnlyNodePersistence() throws Exception {
452
454
);
453
455
454
456
persistedState .markLastAcceptedStateAsCommitted ();
455
- assertBusy (() -> assertTrue (gateway .allPendingAsyncStatesWritten ()));
457
+ assertBusy (() -> assertTrue (gateway .allPendingAsyncStatesWritten ()), 30 , TimeUnit . SECONDS );
456
458
457
459
CoordinationMetadata expectedCoordinationMetadata = CoordinationMetadata .builder (coordinationMetadata )
458
460
.lastCommittedConfiguration (coordinationMetadata .getLastAcceptedConfiguration ())
@@ -506,7 +508,7 @@ public void testDataOnlyNodePersistence() throws Exception {
506
508
assertTrue (wroteState ); // must write it at least once
507
509
assertEquals (currentTerm , persistedState .getCurrentTerm ());
508
510
assertClusterStateEqual (state , persistedState .getLastAcceptedState ());
509
- assertBusy (() -> assertTrue (gateway .allPendingAsyncStatesWritten ()));
511
+ assertBusy (() -> assertTrue (gateway .allPendingAsyncStatesWritten ()), 30 , TimeUnit . SECONDS );
510
512
511
513
gateway .close ();
512
514
assertTrue (cleanup .remove (gateway ));
0 commit comments