@@ -219,12 +219,10 @@ public void testTargetIORateChangesWhenSubmittingMergeTasks() throws Exception {
219219 }
220220 long newIORate = threadPoolMergeExecutorService .getTargetIORateBytesPerSec ();
221221 if (supportsIOThrottling ) {
222- if (submittedIOThrottledMergeTasks .get () < threadPoolMergeExecutorService
223- .getConcurrentMergesFloorLimitForThrottling ()) {
224- // assert the IO rate decreases, with a floor limit, when there are few merge tasks enqueued
222+ if (submittedIOThrottledMergeTasks .get () < 2 ) {
223+ // assert the IO rate decreases, with a floor limit, when there is just a single merge task running
225224 assertThat (newIORate , either (is (MIN_IO_RATE .getBytes ())).or (lessThan (currentIORate )));
226- } else if (submittedIOThrottledMergeTasks .get () > threadPoolMergeExecutorService
227- .getConcurrentMergesCeilLimitForThrottling ()) {
225+ } else if (submittedIOThrottledMergeTasks .get () > threadPoolMergeExecutorService .getMaxConcurrentMerges () * 2 ) {
228226 // assert the IO rate increases, with a ceiling limit, when there are many merge tasks enqueued
229227 assertThat (newIORate , either (is (MAX_IO_RATE .getBytes ())).or (greaterThan (currentIORate )));
230228 } else {
@@ -375,11 +373,10 @@ private void testIORateAdjustedForSubmittedTasks(
375373 initialTasksCounter --;
376374 threadPoolMergeExecutorService .submitMergeTask (mergeTask );
377375 long newTargetIORateLimit = threadPoolMergeExecutorService .getTargetIORateBytesPerSec ();
378- if (currentlySubmittedMergeTaskCount .get () < threadPoolMergeExecutorService . getConcurrentMergesFloorLimitForThrottling () ) {
376+ if (currentlySubmittedMergeTaskCount .get () < 2 ) {
379377 // assert the IO rate decreases, with a floor limit, when there are few merge tasks enqueued
380378 assertThat (newTargetIORateLimit , either (is (MIN_IO_RATE .getBytes ())).or (lessThan (targetIORateLimit .get ())));
381- } else if (currentlySubmittedMergeTaskCount .get () > threadPoolMergeExecutorService
382- .getConcurrentMergesCeilLimitForThrottling ()) {
379+ } else if (currentlySubmittedMergeTaskCount .get () > threadPoolMergeExecutorService .getMaxConcurrentMerges () * 2 ) {
383380 // assert the IO rate increases, with a ceiling limit, when there are many merge tasks enqueued
384381 assertThat (newTargetIORateLimit , either (is (MAX_IO_RATE .getBytes ())).or (greaterThan (targetIORateLimit .get ())));
385382 } else {
0 commit comments