Skip to content

Commit

Permalink
Add Test Logging for elastic#45953
Browse files Browse the repository at this point in the history
Adding some logging to track down elastic#45953 and making the failing assertion log more detail
  • Loading branch information
original-brownbear committed Aug 26, 2019
1 parent e9809b5 commit 8fdca05
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
import org.elasticsearch.test.InternalSettingsPlugin;
import org.elasticsearch.test.InternalTestCluster;
import org.elasticsearch.test.engine.MockEngineSupport;
import org.elasticsearch.test.junit.annotations.TestIssueLogging;
import org.elasticsearch.test.store.MockFSIndexStore;
import org.elasticsearch.test.transport.MockTransportService;
import org.elasticsearch.test.transport.StubbableTransport;
Expand Down Expand Up @@ -856,6 +857,7 @@ public void sendRequest(Transport.Connection connection, long requestId, String
}
}

@TestIssueLogging(value = "org.elasticsearch:DEBUG", issueUrl = "https://github.com/elastic/elasticsearch/issues/45953")
public void testHistoryRetention() throws Exception {
internalCluster().startNodes(3);

Expand Down Expand Up @@ -907,8 +909,9 @@ public void testHistoryRetention() throws Exception {
recoveryStates.removeIf(r -> r.getTimer().getStartNanoTime() <= desyncNanoTime);

assertThat(recoveryStates, hasSize(1));
assertThat(recoveryStates.get(0).getIndex().totalFileCount(), is(0));
assertThat(recoveryStates.get(0).getTranslog().recoveredOperations(), greaterThan(0));
final RecoveryState recoveryState = recoveryStates.get(0);
assertThat(recoveryState.toString(), recoveryState.getIndex().totalFileCount(), is(0));
assertThat(recoveryState.getTranslog().recoveredOperations(), greaterThan(0));
}

public void testDoNotInfinitelyWaitForMapping() {
Expand Down

0 comments on commit 8fdca05

Please sign in to comment.