[FLINK-39954][tests] Relax SinkV2 scaling commit assertion#28507
Open
qiuyanjun888 wants to merge 2 commits into
Open
[FLINK-39954][tests] Relax SinkV2 scaling commit assertion#28507qiuyanjun888 wants to merge 2 commits into
qiuyanjun888 wants to merge 2 commits into
Conversation
spuru9
reviewed
Jun 22, 2026
| assertThat(remainingActual).contains(expectedRecord); | ||
| remainingActual.remove(expectedRecord); | ||
| } | ||
| assertThat(remainingActual).allSatisfy(record -> assertThat(expected).contains(record)); |
Contributor
There was a problem hiding this comment.
Suggested change
| assertThat(remainingActual).allSatisfy(record -> assertThat(expected).contains(record)); | |
| assertThat(remainingActual).isSubsetOf(expected); |
Author
There was a problem hiding this comment.
Fixed by applying the suggested isSubsetOf(expected) assertion for the remaining actual records.
Verification:
git diff --checkJAVA_HOME=/opt/data/jdks/jdk-17.0.19+10 ./mvnw -pl flink-tests -Dtest=SinkV2ITCase#committedRecordAssertionAllowsAdditionalRetriedCommittables test
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.
What is the purpose of the change
FLINK-39954 reports that
SinkV2ITCase.writerAndCommitterExecuteInStreamingModeWithScalingover-specifies the exact number of commit attempts under unaligned checkpoints. TheCommittercontract requires idempotent commit handling and allows repeated commit attempts after recovery, so the test should not fail solely because an expected committable is retried more often.Summary
SinkV2ITCase; no production code or runtime semantics are changed.Root Cause
The scaling IT used
containsExactlyInAnyOrderElementsOf(duplicate(EXPECTED_COMMITTED_DATA_IN_STREAMING_MODE)), which asserts an exact commit multiplicity. Under unaligned checkpoints and recovery, a boundary committable can be retried in addition to the expected baseline commits. That is valid for an idempotent committer, but the test committer records every commit request and the exact-multiplicity assertion treats the extra retry as unexpected.Brief change log
committedRecordAssertionAllowsAdditionalRetriedCommittablesto cover the previously over-strict assertion case.Changes
SinkV2ITCasenow verifies that all expected committed records are present with at least the required multiplicity.Verifying this change
This change added tests and can be verified as follows:
./mvnw -pl flink-tests -Dtest=SinkV2ITCase#committedRecordAssertionAllowsAdditionalRetriedCommittables -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false -Dcheckstyle.skip -Drat.skip=true -Dspotless.check.skip=true -Djapicmp.skip=true test./mvnw -pl flink-tests -Dtest=SinkV2ITCase#committedRecordAssertionAllowsAdditionalRetriedCommittables -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false -Dcheckstyle.skip -Drat.skip=true -Dspotless.check.skip=true -Djapicmp.skip=true test./mvnw -pl flink-tests -Dtest=SinkV2ITCase -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false -Dcheckstyle.skip -Drat.skip=true -Dspotless.check.skip=true -Djapicmp.skip=true test./mvnw -pl flink-tests -DskipTests -DskipITs -Dcheckstyle.skip -Drat.skip=true -Djapicmp.skip=true spotless:check./mvnw -pl flink-tests -DskipTests -DskipITs -Drat.skip=true -Dspotless.check.skip=true -Djapicmp.skip=true checkstyle:checkValidation
SinkV2ITCase#committedRecordAssertionAllowsAdditionalRetriedCommittables: PASS after the fix.SinkV2ITCase: PASS.spotless:checkforflink-tests: PASS.checkstyle:checkforflink-tests: PASS.Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation
Was generative AI tooling used to co-author this PR?
Generated-by: Hermes Agent (OpenAI GPT-5.5)