Skip to content

Commit af7e7b1

Browse files
committed
Fix lower size bounds in RandomBlobContent*Tests (#69771)
The repository analyzer does not write empty blobs to the repository, and we assert that the blobs are nonempty, but the tests randomly check for the empty case anyway. This commit ensures that the blobs used in tests are always nonempty. Relates #67247
1 parent 0a1ede2 commit af7e7b1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public void testStreamInput() throws IOException {
4848
}
4949

5050
private static int randomSize() {
51-
return between(0, 30000);
51+
return between(1, 30000);
5252
}
5353

5454
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public void testReadingBytesThrowsExceptionAfterCancellation() {
131131
}
132132

133133
private static int randomSize() {
134-
return between(0, 30000);
134+
return between(1, 30000);
135135
}
136136

137137
private static void readAllBytes(InputStream inputStream) throws IOException {

0 commit comments

Comments
 (0)