Skip to content

Commit 0199b5c

Browse files
authored
Enable TRACE Logging for test and increase timeout (#88477) (#89750)
1 parent a9b79a7 commit 0199b5c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

server/src/test/java/org/elasticsearch/gateway/GatewayMetaStatePersistedStateTests.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import org.elasticsearch.indices.breaker.NoneCircuitBreakerService;
4040
import org.elasticsearch.node.Node;
4141
import org.elasticsearch.test.ESTestCase;
42+
import org.elasticsearch.test.junit.annotations.TestIssueLogging;
4243
import org.elasticsearch.threadpool.TestThreadPool;
4344
import org.elasticsearch.threadpool.ThreadPool;
4445
import 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

Comments
 (0)