Skip to content

Commit

Permalink
Remove renewal in retention lease recovery test (#42536)
Browse files Browse the repository at this point in the history
This commit removes the act of renewing some retention leases during a
retention lease recovery test. Having renewal does not add anything
extra to this test, but does allow for some situations where the test
can fail spuriously (i.e., in a way that does not indicate that
production code is broken).
  • Loading branch information
jasontedor committed May 24, 2019
1 parent 65e9896 commit a8eb7fb
Showing 1 changed file with 0 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import org.elasticsearch.indices.recovery.PeerRecoveryTargetService;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.junit.annotations.TestLogging;
import org.elasticsearch.test.transport.MockTransportService;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
Expand Down Expand Up @@ -359,7 +358,6 @@ public void testRetentionLeasesBackgroundSyncWithSoftDeletesDisabled() throws Ex
assertFalse("retention leases background sync must be a noop if soft deletes is disabled", backgroundSyncRequestSent.get());
}

@TestLogging(value = "org.elasticsearch.indices.recovery:trace")
public void testRetentionLeasesSyncOnRecovery() throws Exception {
final int numberOfReplicas = 2 - scaledRandomIntBetween(0, 2);
internalCluster().ensureAtLeastNumDataNodes(1 + numberOfReplicas);
Expand Down Expand Up @@ -396,7 +394,6 @@ public void testRetentionLeasesSyncOnRecovery() throws Exception {
final ActionListener<ReplicationResponse> listener = ActionListener.wrap(r -> latch.countDown(), e -> fail(e.toString()));
currentRetentionLeases.put(id, primary.addRetentionLease(id, retainingSequenceNumber, source, listener));
latch.await();
currentRetentionLeases.put(id, primary.renewRetentionLease(id, retainingSequenceNumber, source));
}
logger.info("finished adding [{}] retention leases", length);

Expand Down

0 comments on commit a8eb7fb

Please sign in to comment.