Fix flaky TableMetadataReaderCompressionTest concurrency - #19243
Merged
xiangfu0 merged 1 commit intoAug 13, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a known flake in TableMetadataReaderCompressionTest by ensuring the embedded preferred mock HttpServer can execute concurrent request handlers, matching the test’s intended concurrent deadline behavior.
Changes:
- Run the preferred mock compression server with a dedicated 2-thread executor to avoid serialized handler execution.
- Update the preferred-handler synchronization to wait for two independent preferred requests to enter the blocking handler.
- Clean up the new executor during test teardown to avoid thread leakage.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19243 +/- ##
============================================
- Coverage 66.97% 66.94% -0.04%
- Complexity 1417 1423 +6
============================================
Files 3453 3453
Lines 218858 218858
Branches 34787 34787
============================================
- Hits 146591 146522 -69
- Misses 60556 60616 +60
- Partials 11711 11720 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Jackie-Jiang
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause
The embedded
HttpServerused its default executor, which serializes request handlers. This test sends final and retryable segment requests to the same preferred endpoint while deliberately blocking the handler. When the final request entered first, the retryable request could reach its half-deadline and be cancelled before its queued handler incremented the request counter. The test then reportedexpected [2] but found [1]even though the production deadline behavior was correct.How to reproduce
On an unfixed checkout, repeatedly run the failing method under JDK 25 with test retries disabled:
The race is recorded in #19065 and in GitHub Actions job 94326703474, where the assertion failed after approximately the retryable half-deadline.
Validation
TableMetadataReaderCompressionTest: 24 tests passed, 0 failures/errors/skips.spotless:apply,checkstyle:check,license:format, andlicense:check: passed forpinot-controller.git diff --check: passed.Closes #19065.