[TEST] Fix off-by-one bug in corruptFile util function
The upper bound must be 0-based since we are corrupting an offset into the file but it can be a 1-based length of the file which results in an uncorrupted file.
This commit is contained in:
parent
ce00241440
commit
ed9eef92dd
|
@ -655,7 +655,7 @@ public class StoreTest extends ESTestCase {
|
|||
IndexOutput output = dir.createOutput(fileOut, IOContext.DEFAULT);
|
||||
long len = input.length();
|
||||
byte[] b = new byte[1024];
|
||||
long broken = randomInt((int) len);
|
||||
long broken = randomInt((int) len-1);
|
||||
long pos = 0;
|
||||
while (pos < len) {
|
||||
int min = (int) Math.min(input.length() - pos, b.length);
|
||||
|
|
Loading…
Reference in New Issue