diff --git a/muted-tests.yml b/muted-tests.yml index 9a9b7e1af7fab..28c583b143a28 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -551,9 +551,6 @@ tests: - class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeIT method: test issue: https://github.com/elastic/elasticsearch/issues/129819 -- class: org.elasticsearch.index.engine.ThreadPoolMergeExecutorServiceDiskSpaceTests - method: testAbortingOrRunningMergeTaskHoldsUpBudget - issue: https://github.com/elastic/elasticsearch/issues/129823 - class: org.elasticsearch.index.store.FsDirectoryFactoryTests method: testPreload issue: https://github.com/elastic/elasticsearch/issues/129852 diff --git a/server/src/test/java/org/elasticsearch/index/engine/ThreadPoolMergeExecutorServiceDiskSpaceTests.java b/server/src/test/java/org/elasticsearch/index/engine/ThreadPoolMergeExecutorServiceDiskSpaceTests.java index 6eaafd6e3a3ac..5b97878b18450 100644 --- a/server/src/test/java/org/elasticsearch/index/engine/ThreadPoolMergeExecutorServiceDiskSpaceTests.java +++ b/server/src/test/java/org/elasticsearch/index/engine/ThreadPoolMergeExecutorServiceDiskSpaceTests.java @@ -534,7 +534,7 @@ public void testAbortingOrRunningMergeTaskHoldsUpBudget() throws Exception { aFileStore.totalSpace = randomLongBetween(1_000L, 10_000L); bFileStore.totalSpace = randomLongBetween(1_000L, 10_000L); aFileStore.usableSpace = randomLongBetween(900L, aFileStore.totalSpace); - bFileStore.usableSpace = randomLongBetween(900L, bFileStore.totalSpace); + bFileStore.usableSpace = randomValueOtherThan(aFileStore.usableSpace, () -> randomLongBetween(900L, bFileStore.totalSpace)); boolean aHasMoreSpace = aFileStore.usableSpace > bFileStore.usableSpace; try ( ThreadPoolMergeExecutorService threadPoolMergeExecutorService = ThreadPoolMergeExecutorService @@ -613,7 +613,7 @@ public void testBackloggedMergeTasksDoNotHoldUpBudget() throws Exception { aFileStore.totalSpace = randomLongBetween(1_000L, 10_000L); bFileStore.totalSpace = randomLongBetween(1_000L, 10_000L); aFileStore.usableSpace = randomLongBetween(900L, aFileStore.totalSpace); - bFileStore.usableSpace = randomLongBetween(900L, bFileStore.totalSpace); + bFileStore.usableSpace = randomValueOtherThan(aFileStore.usableSpace, () -> randomLongBetween(900L, bFileStore.totalSpace)); boolean aHasMoreSpace = aFileStore.usableSpace > bFileStore.usableSpace; try ( ThreadPoolMergeExecutorService threadPoolMergeExecutorService = ThreadPoolMergeExecutorService @@ -900,7 +900,7 @@ public void testEnqueuedMergeTasksAreUnblockedWhenEstimatedMergeSizeChanges() th long diskSpaceLimitBytes = randomLongBetween(10L, 100L); aFileStore.usableSpace = diskSpaceLimitBytes + randomLongBetween(1L, 100L); aFileStore.totalSpace = aFileStore.usableSpace + randomLongBetween(1L, 10L); - bFileStore.usableSpace = diskSpaceLimitBytes + randomLongBetween(1L, 100L); + bFileStore.usableSpace = randomValueOtherThan(aFileStore.usableSpace, () -> diskSpaceLimitBytes + randomLongBetween(1L, 100L)); bFileStore.totalSpace = bFileStore.usableSpace + randomLongBetween(1L, 10L); boolean aHasMoreSpace = aFileStore.usableSpace > bFileStore.usableSpace; Settings.Builder settingsBuilder = Settings.builder().put(settings); @@ -1001,7 +1001,10 @@ public void testMergeTasksAreUnblockedWhenMoreDiskSpaceBecomesAvailable() throws bFileStore.totalSpace = randomLongBetween(300L, 1_000L); long grantedUsableSpaceBuffer = randomLongBetween(10L, 50L); aFileStore.usableSpace = randomLongBetween(200L, aFileStore.totalSpace - grantedUsableSpaceBuffer); - bFileStore.usableSpace = randomLongBetween(200L, bFileStore.totalSpace - grantedUsableSpaceBuffer); + bFileStore.usableSpace = randomValueOtherThan( + aFileStore.usableSpace, + () -> randomLongBetween(200L, bFileStore.totalSpace - grantedUsableSpaceBuffer) + ); boolean aHasMoreSpace = aFileStore.usableSpace > bFileStore.usableSpace; Settings.Builder settingsBuilder = Settings.builder().put(settings); // change the watermark level, just for coverage and it's easier with the calculations