Skip to content

Commit 08c54f1

Browse files
authored
Enable TRACE Logging for test and increase timeout (#88477)
1 parent c636e43 commit 08c54f1

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.env.TestEnvironment;
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;
@@ -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

Comments
 (0)