Skip to content

Commit e3e7773

Browse files
Fix for loop
1 parent a630a63 commit e3e7773

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/src/test/java/org/elasticsearch/index/engine/ThreadPoolMergeSchedulerTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ public void testMergesRunConcurrently() throws Exception {
493493
// at least 1 extra merge than there are concurrently allowed
494494
int mergeCount = mergeExecutorThreadCount + randomIntBetween(1, 10);
495495
Semaphore runMergeSemaphore = new Semaphore(0);
496-
for (int i = 1; i <= mergeCount; i++) {
496+
for (int i = 0; i < mergeCount; i++) {
497497
MergeSource mergeSource = mock(MergeSource.class);
498498
OneMerge oneMerge = mock(OneMerge.class);
499499
when(oneMerge.getStoreMergeInfo()).thenReturn(getNewMergeInfo(randomLongBetween(1L, 10L)));
@@ -509,7 +509,7 @@ public void testMergesRunConcurrently() throws Exception {
509509
threadPoolMergeScheduler.merge(mergeSource, randomFrom(MergeTrigger.values()));
510510

511511
// verify queued byte metric is recorded for each merge
512-
verify(mergeMetrics, times(i)).incrementQueuedMergeBytes(any(), anyLong());
512+
verify(mergeMetrics, times(i + 1)).incrementQueuedMergeBytes(any(), anyLong());
513513
}
514514

515515
for (int completedMergesCount = 0; completedMergesCount < mergeCount

0 commit comments

Comments
 (0)