Fix off-by-one error in shard changes action test

This commit fixes an off-by-one error in the shard changes action test
for getting operations between two sequence numbers. The off-by-one
error arises because sequence numbers are indexed from zero, so if N
documents are indexed then the maximum sequence number starting from
zero would be N - 1.
This commit is contained in:
Jason Tedor 2017-10-16 08:54:04 +02:00
parent 1f495f59a1
commit bcd61bfca5

View File

@ -40,7 +40,7 @@ public class ShardChangesActionTests extends ESSingleNodeTestCase {
IndexShard indexShard = indexService.getShard(0);
for (int iter = 0; iter < iters; iter++) {
int min = randomIntBetween(0, numWrites - 1);
int max = randomIntBetween(min, numWrites);
int max = randomIntBetween(min, numWrites - 1);
int index = 0;
List<Translog.Operation> operations = ShardChangesAction.getOperationsBetween(indexShard, min, max);