[test] Fix unstable unaware bucket read test and assert split distribution#8850
Open
wombatu-kun wants to merge 1 commit into
Open
[test] Fix unstable unaware bucket read test and assert split distribution#8850wombatu-kun wants to merge 1 commit into
wombatu-kun wants to merge 1 commit into
Conversation
…ution Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Purpose
AppendOnlyTableITCase.testReadUnawareBucketTableWithRebalanceShuffleflakes on unrelated PRs (latest #8839, onUTCase and ITCase Flink 2.x on JDK 11) and never checked what its name says.It asserted that the first 2 of 8 rows were
{1, 2}. Each written file holds(1,'AAA')then(2,'BBB'), so every reader emits its1before its2, and[1, 2]only appears when the rebalance happens not to interleave;[1, 1]is the normal parallel outcome. Before #3955 all splits of a single bucket table went to channel 0, one subtask read them serially, and the first two rows were still1and2. So the assertion passes with the bug and flakes without it.Tests
Asserting the distribution needs per subtask metrics, hence a
JobIDand a MiniCluster with a metric reporter.AppendOnlyTableITCasehas neither, hence the move.The case is now
UnawareBucketSplitShuffleITCase, a MiniCluster with anInMemoryReporteras inSourceMetricsITCase, keeping the DDL, the SQL and the data. It asserts all 8 rows order independent, plusnumRecordsIn > 0on each of the 4 reader subtasks, which is the split distribution the old test claimed to cover.Checked to be non vacuous: forcing
MonitorSource.buildSourceontoshuffleOrderedmakes it fail with[0, 0, 0, 8]while the row assertion still passes. Run 20 times onflink2/ JDK 11 and onflink1/ JDK 8, together with the fullAppendOnlyTableITCase.