mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-22 21:05:23 +00:00
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:
parent
1f495f59a1
commit
bcd61bfca5
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user