This is an automated email from the ASF dual-hosted git repository.

gianm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new 617d63d4845 perf(test): Reduce PartialCompactionTest run time from 42s 
to 7s (#20306)
617d63d4845 is described below

commit 617d63d484573cbe432f0cf1115765e4cae03236
Author: Frank Chen <[email protected]>
AuthorDate: Thu Sep 10 08:04:49 2026 +0800

    perf(test): Reduce PartialCompactionTest run time from 42s to 7s (#20306)
    
    PartialCompactionTest always builds its tuning config with
    maxNumConcurrentSubTasks = 2, so it falls back to the 1000ms production
    default for taskStatusCheckPeriodMs. Each of its three back-to-back
    indexing/compaction rounds pays up to a full poll period per phase
    transition, which dominates the test's wall-clock time.
    
    Override newTuningConfig in this class to poll every 100ms. The override
    mirrors the base builder exactly except for the poll interval. None of the
    class's assertions depend on poll cadence, and the injected transient
    task/API failures are retried by count, not time, so they behave the same.
    
    CI (JDK 25): 42.00s -> 7.31s, 35.54s -> 5.71s, 24.13s -> 3.85s.
---
 .../AbstractParallelIndexSupervisorTaskTest.java        | 17 +++++++++++++++--
 .../task/batch/parallel/PartialCompactionTest.java      | 12 ++++++++++++
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git 
a/indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/AbstractParallelIndexSupervisorTaskTest.java
 
b/indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/AbstractParallelIndexSupervisorTaskTest.java
index 1f7b8c54ebd..6878235a242 100644
--- 
a/indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/AbstractParallelIndexSupervisorTaskTest.java
+++ 
b/indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/AbstractParallelIndexSupervisorTaskTest.java
@@ -162,6 +162,7 @@ public class AbstractParallelIndexSupervisorTaskTest 
extends IngestionTestBase
 
   protected static final double DEFAULT_TRANSIENT_TASK_FAILURE_RATE = 0.2;
   protected static final double DEFAULT_TRANSIENT_API_FAILURE_RATE = 0.2;
+  protected static final long SHORT_TASK_STATUS_CHECK_PERIOD_MS = 100L;
 
   private static final Logger LOG = new 
Logger(AbstractParallelIndexSupervisorTaskTest.class);
 
@@ -251,12 +252,24 @@ public class AbstractParallelIndexSupervisorTaskTest 
extends IngestionTestBase
                               .withPartitionsSpec(partitionsSpec)
                               .withForceGuaranteedRollup(forceGuaranteedRollup)
                               
.withMaxNumConcurrentSubTasks(maxNumConcurrentSubTasks)
-                              // Serial tests need only a short poll interval; 
concurrent tests retain the default.
-                              
.withTaskStatusCheckPeriodMs(maxNumConcurrentSubTasks == 1 ? 100L : null)
+                              
.withTaskStatusCheckPeriodMs(getTaskStatusCheckPeriodMs(maxNumConcurrentSubTasks))
                               .withMaxParseExceptions(5)
                               .build();
   }
 
+  /**
+   * Task-status poll interval used by {@link #newTuningConfig}. Serial tests 
need only a short poll interval;
+   * concurrent tests retain the production default. Subclasses whose 
assertions do not depend on poll cadence
+   * can override this to cut wall-clock time without duplicating the rest of 
the tuning config.
+   *
+   * @return the poll interval in millis, or null to use the production default
+   */
+  @Nullable
+  protected Long getTaskStatusCheckPeriodMs(int maxNumConcurrentSubTasks)
+  {
+    return maxNumConcurrentSubTasks == 1 ? SHORT_TASK_STATUS_CHECK_PERIOD_MS : 
null;
+  }
+
   protected LocalOverlordClient getIndexingServiceClient()
   {
     return indexingServiceClient;
diff --git 
a/indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/PartialCompactionTest.java
 
b/indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/PartialCompactionTest.java
index 0992ffa5ddc..72be71e966c 100644
--- 
a/indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/PartialCompactionTest.java
+++ 
b/indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/PartialCompactionTest.java
@@ -80,6 +80,18 @@ public class PartialCompactionTest extends 
AbstractMultiPhaseParallelIndexingTes
     super(LockGranularity.TIME_CHUNK, DEFAULT_TRANSIENT_TASK_FAILURE_RATE, 
DEFAULT_TRANSIENT_API_FAILURE_RATE);
   }
 
+  /**
+   * This test drives several rounds of parallel indexing/compaction (each 
with its own
+   * determine-partitions/generate/merge phases) back-to-back, always with 
concurrent sub-tasks, so the
+   * base implementation would poll task status at the 1-second production 
default and pay up to a full
+   * period per phase transition. None of the assertions here depend on the 
poll cadence, so poll quickly.
+   */
+  @Override
+  protected Long getTaskStatusCheckPeriodMs(int 
ignoredMaxNumConcurrentSubTasks)
+  {
+    return SHORT_TASK_STATUS_CHECK_PERIOD_MS;
+  }
+
   @BeforeEach
   public void setup() throws IOException
   {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to