Skip to content

perf(test): cut high-cost CI test latency while preserving coverage - #20127

Open
FrankChen021 wants to merge 12 commits into
apache:masterfrom
FrankChen021:codex/optimize-test-shards-combined
Open

perf(test): cut high-cost CI test latency while preserving coverage#20127
FrankChen021 wants to merge 12 commits into
apache:masterfrom
FrankChen021:codex/optimize-test-shards-combined

Conversation

@FrankChen021

Copy link
Copy Markdown
Member

Summary

Reduce avoidable latency in high-cost test fixtures and setup paths while preserving test payloads, ordering, partitioning, transaction boundaries, retry/failure injection, and assertions.

The optimized values are averages of passing local Surefire runs. Interrupted or resource-limited runs are excluded.

Surefire duration comparison

Test Original Surefire Optimized average Surefire Improvement
AutoCompactionTest filtered supervisor tests 245.171s 13.863s 231.308s / 94.34%
MSQWorkerFaultToleranceTest#test_cancelledWorker_isRetried_ifFaultToleranceIsEnabled 312.000s 12.845s 299.155s / 95.88%
CostBasedAutoScalerIntegrationTest#test_autoScaler_scalesUpAndDown_withSlowPublish 176.500s 75.220s 101.280s / 57.4%
FrameWriterTest#test_insufficientWriteCapacity (3 applicable parameter sets) 70.950s 10.525s 60.425s / 85.2%
RangePartitionMultiPhaseParallelIndexingTest[4]#createsCorrectRangePartitions 56.770s 12.185s 44.585s / 78.5%
KafkaRecordSupplierTest#testSeekUnassigned 125.3s 5.7s 119.6s / 95.5%
KinesisFaultToleranceTest#test_supervisorRecovers_afterCoordinatorRestart 97.6s 43.0s 54.7s / 56.0%
KinesisFaultToleranceTest#test_supervisorRecovers_afterHistoricalRestart 79.0s 33.7s 45.2s / 57.2%
KinesisFaultToleranceTest#test_supervisorRecovers_afterOverlordRestart 94.2s 39.5s 54.7s / 58.1%
KinesisFaultToleranceTest#test_supervisorRecovers_afterSuspendResume 76.4s 35.3s 41.1s / 53.8%
MergingRowIteratorTest#testAllPossible5ElementSequences 53.845s 35.635s 18.210s / 33.8%

Validation

  • Rebased onto the latest apache/druid/master.
  • mvn -ntp test-compile -pl embedded-tests,processing,indexing-service -am -Pskip-static-checks -Dweb.console.skip=true -T1C — passed.
  • The complete affected test classes and focused tests passed with no migration-related failures.
  • Checkstyle, SpotBugs, and git diff --check passed before publication.

@FrankChen021
FrankChen021 marked this pull request as ready for review August 25, 2026 02:46
Copilot AI lite review requested due to automatic review settings August 25, 2026 02:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@FrankChen021 FrankChen021 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity Findings
P0 0
P1 0
P2 2
P3 0
Total 2

The review found two P2 test and integration risks affecting fault-tolerance timing and Kinesis request batching.

Reviewed 9 of 9 changed files.


This is an automated review by Codex GPT-5.6-Luna(max)

.addProperty("druid.unsafe.cluster.testing", "true")
.addProperty("druid.unsafe.cluster.testing.overlordClient.taskStatusDelay", "PT1H")
// Keep the injected delay short so the retry path is exercised without a one-hour wait.
.addProperty("druid.unsafe.cluster.testing.overlordClient.taskStatusDelay", "PT1S")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] One-second delay no longer reliably blocks the faulty worker

The faulty worker can resume after this delay while the functional indexer is starting, allowing it to finish before cancellation. The FAILED assertion then becomes timing-dependent. Keep the delay longer than setup or synchronize on a state proving the worker remains blocked.

Function<byte[], String> partitionKeyFunction
)
{
for (int start = 0; start < records.size(); start += PUT_RECORDS_BATCH_SIZE) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Batching ignores Kinesis aggregate request-size limit

PutRecords is limited to both 500 records and a 5 MiB aggregate payload. A 500-record batch can exceed 5 MiB and be rejected, whereas the previous per-record loop accepted individually valid records. Bound batches by total size as well as count.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants