Skip to content

Commit fe6f50e

Browse files
authored
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 2ce0f86 commit fe6f50e

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
@@ -46,7 +46,7 @@ public void testStreamInput() throws IOException {
4646
}
4747

4848
private static int randomSize() {
49-
return between(0, 30000);
49+
return between(1, 30000);
5050
}
5151

5252
}

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
@@ -130,7 +130,7 @@ public void testReadingBytesThrowsExceptionAfterCancellation() {
130130
}
131131

132132
private static int randomSize() {
133-
return between(0, 30000);
133+
return between(1, 30000);
134134
}
135135

136136
}

0 commit comments

Comments
 (0)