BytesArray tests fix: offsets don't matter on a zero bytes array
Closes #19582
This commit is contained in:
parent
a9ab095b8c
commit
2f831c3abb
|
@ -430,7 +430,7 @@ public abstract class AbstractBytesReferenceTestCase extends ESTestCase {
|
|||
int length = randomInt(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(0, pbr.length() - sliceOffset);
|
||||
int sliceLength = randomIntBetween(1, pbr.length() - sliceOffset);
|
||||
BytesReference slice = pbr.slice(sliceOffset, sliceLength);
|
||||
BytesRef singlePageOrNull = getSinglePageOrNull(slice);
|
||||
if (singlePageOrNull != null) {
|
||||
|
|
Loading…
Reference in New Issue