diff --git a/test/framework/src/main/java/org/elasticsearch/common/bytes/AbstractBytesReferenceTestCase.java b/test/framework/src/main/java/org/elasticsearch/common/bytes/AbstractBytesReferenceTestCase.java index f3fd0e2f9c0..c6551543473 100644 --- a/test/framework/src/main/java/org/elasticsearch/common/bytes/AbstractBytesReferenceTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/common/bytes/AbstractBytesReferenceTestCase.java @@ -432,7 +432,7 @@ public abstract class AbstractBytesReferenceTestCase extends ESTestCase { } public void testSliceArrayOffset() throws IOException { - int length = randomInt(PAGE_SIZE * randomIntBetween(2, 5)); + int length = randomIntBetween(1, PAGE_SIZE * randomIntBetween(2, 5)); BytesReference pbr = newBytesReference(length); int sliceOffset = randomIntBetween(0, pbr.length() - 1); // an offset to the end would be len 0 int sliceLength = randomIntBetween(1, pbr.length() - sliceOffset);