Skip to content

Commit 2a24918

Browse files
authored
RepositoryAnalysisFailureIT: fix testFailsOnWriteException (#126750)
With the addition of copy coverage in the repository analyzer, blob count is no longer 1:1 with blob analyzer request count: requests that create a copy count as two blobs. This can cause testFailsOnWriteException to sometimes fail, because this test randomly injects a failure somewhere between the first and blobCounth request, which may never happen if enough of the requests create copies. This simple fix is to inject the failure within blobCount/2 requests, which we will see even if every request generates a copy. An alternative could be to add a knob to the request to disallow copies and use that during this test. Closes #126747
1 parent e461717 commit 2a24918

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,6 @@ tests:
408408
- class: org.elasticsearch.xpack.ilm.TimeSeriesDataStreamsIT
409409
method: testShrinkActionInPolicyWithoutHotPhase
410410
issue: https://github.com/elastic/elasticsearch/issues/126746
411-
- class: org.elasticsearch.repositories.blobstore.testkit.analyze.RepositoryAnalysisFailureIT
412-
method: testFailsOnWriteException
413-
issue: https://github.com/elastic/elasticsearch/issues/126747
414411
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
415412
method: test {p0=transform/transforms_start_stop/Test start/stop/start continuous transform}
416413
issue: https://github.com/elastic/elasticsearch/issues/126755

x-pack/plugin/snapshot-repo-test-kit/src/internalClusterTest/java/org/elasticsearch/repositories/blobstore/testkit/analyze/RepositoryAnalysisFailureIT.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,9 @@ public void testFailsOnWriteException() {
234234
request.maxBlobSize(ByteSizeValue.ofBytes(10L));
235235
request.abortWritePermitted(false);
236236

237-
final CountDown countDown = new CountDown(between(1, request.getBlobCount()));
237+
// requests that create copies count as two blobs. Halving the count ensures that we trigger the disruption
238+
// even if every request is a copy
239+
final CountDown countDown = new CountDown(between(1, request.getBlobCount() / 2));
238240

239241
blobStore.setDisruption(new Disruption() {
240242

0 commit comments

Comments
 (0)