Skip to content

Commit 7c20628

Browse files
author
Ali Beyad
committed
[TEST] No longer randomly block on the index-N files in the
MockRepository, because the getRepositoryData() call depends on it, which is used in non-synchronized actions such as getting snapshot status.
1 parent c92f6f6 commit 7c20628

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/src/test/java/org/elasticsearch/snapshots/mockstore/MockRepository.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,9 @@ private void maybeIOExceptionOrBlock(String blobName) throws IOException {
267267
}
268268
}
269269
}
270-
} else {
270+
}
271+
// don't block on the index-N files, as getRepositoryData depends on it
272+
else if (blobName.startsWith("index-") == false) {
271273
if (shouldFail(blobName, randomControlIOExceptionRate) && (incrementAndGetFailureCount() < maximumNumberOfFailures)) {
272274
logger.info("throwing random IOException for file [{}] at path [{}]", blobName, path());
273275
throw new IOException("Random IOException");

0 commit comments

Comments
 (0)