Skip to content

Commit 0c7fc22

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 f4270f9 commit 0c7fc22

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
@@ -269,7 +269,9 @@ private void maybeIOExceptionOrBlock(String blobName) throws IOException {
269269
}
270270
}
271271
}
272-
} else {
272+
}
273+
// don't block on the index-N files, as getRepositoryData depends on it
274+
else if (blobName.startsWith("index-") == false) {
273275
if (shouldFail(blobName, randomControlIOExceptionRate) && (incrementAndGetFailureCount() < maximumNumberOfFailures)) {
274276
logger.info("throwing random IOException for file [{}] at path [{}]", blobName, path());
275277
throw new IOException("Random IOException");

0 commit comments

Comments
 (0)