Skip to content

Commit

Permalink
Enable TRACE Logging for test and increase timeout (elastic#88477)
Browse files Browse the repository at this point in the history
  • Loading branch information
pxsalehi committed Aug 31, 2022
1 parent a9b79a7 commit 9a1030a
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.elasticsearch.indices.breaker.NoneCircuitBreakerService;
import org.elasticsearch.node.Node;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.junit.annotations.TestIssueLogging;
import org.elasticsearch.threadpool.TestThreadPool;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
Expand Down Expand Up @@ -374,6 +375,7 @@ public void testStatePersistedOnLoad() throws IOException {
}
}

@TestIssueLogging(value = "org.elasticsearch.gateway:TRACE", issueUrl = "https://github.com/elastic/elasticsearch/issues/87952")
public void testDataOnlyNodePersistence() throws Exception {
final List<Closeable> cleanup = new ArrayList<>(2);

Expand Down Expand Up @@ -431,7 +433,7 @@ public void testDataOnlyNodePersistence() throws Exception {
);
persistedState.setCurrentTerm(state.term());
persistedState.setLastAcceptedState(state);
assertBusy(() -> assertTrue(gateway.allPendingAsyncStatesWritten()));
assertBusy(() -> assertTrue(gateway.allPendingAsyncStatesWritten()), 30, TimeUnit.SECONDS);

assertThat(
persistedState.getLastAcceptedState().getLastAcceptedConfiguration(),
Expand All @@ -449,7 +451,7 @@ public void testDataOnlyNodePersistence() throws Exception {
);

persistedState.markLastAcceptedStateAsCommitted();
assertBusy(() -> assertTrue(gateway.allPendingAsyncStatesWritten()));
assertBusy(() -> assertTrue(gateway.allPendingAsyncStatesWritten()), 30, TimeUnit.SECONDS);

CoordinationMetadata expectedCoordinationMetadata = CoordinationMetadata.builder(coordinationMetadata)
.lastCommittedConfiguration(coordinationMetadata.getLastAcceptedConfiguration())
Expand Down Expand Up @@ -503,7 +505,7 @@ public void testDataOnlyNodePersistence() throws Exception {
assertTrue(wroteState); // must write it at least once
assertEquals(currentTerm, persistedState.getCurrentTerm());
assertClusterStateEqual(state, persistedState.getLastAcceptedState());
assertBusy(() -> assertTrue(gateway.allPendingAsyncStatesWritten()));
assertBusy(() -> assertTrue(gateway.allPendingAsyncStatesWritten()), 30, TimeUnit.SECONDS);

gateway.close();
assertTrue(cleanup.remove(gateway));
Expand Down

0 comments on commit 9a1030a

Please sign in to comment.