[FLINK-38534][runtime/tests] Fix flaky LocalRecoveryTest#27767
Open
mukul-8 wants to merge 1 commit intoapache:masterfrom
Open
[FLINK-38534][runtime/tests] Fix flaky LocalRecoveryTest#27767mukul-8 wants to merge 1 commit intoapache:masterfrom
mukul-8 wants to merge 1 commit intoapache:masterfrom
Conversation
reach RUNNING state The test was flaky because it triggered a checkpoint immediately after calling setAllExecutionsToRunning() without verifying that tasks actually transitioned to RUNNING state. While state updates are synchronous, they trigger async callbacks that need time to process. In slower CI environments, the checkpoint coordinator may not have finished processing state updates, causing the checkpoint trigger to be rejected and the test to timeout. Added waitForAllTasksRunning() utility method to ensure all task executions are in RUNNING state before triggering the checkpoint, eliminating the race condition. Verified with 300+ local test iterations without failure.
Collaborator
davidradl
reviewed
Mar 13, 2026
| * Waits until all task executions in the given ExecutionGraph reach RUNNING state. | ||
| * | ||
| * @param executionGraph the ExecutionGraph to check | ||
| * @throws Exception if the condition is not met within the timeout period |
Contributor
There was a problem hiding this comment.
We have seen other tests with this sort of resolution. I think this is reasonable. If we see timeouts then there will be another new underlying issue, casing the vertices not to get to running. Is the timeout long enough for the slow CIs?
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.
The test was flaky because it triggered a checkpoint immediately after calling setAllExecutionsToRunning() without verifying that tasks actually transitioned to RUNNING state. While state updates are synchronous, they trigger async callbacks that need time to process. In slower CI environments, the checkpoint coordinator may not have finished processing state updates, causing the checkpoint trigger to be rejected and the test to timeout.
Added waitForAllTasksRunning() utility method to ensure all task executions are in RUNNING state before triggering the checkpoint, eliminating the race condition.
Verified with 300+ local test iterations without failure.
What is the purpose of the change
Fixes FLINK-38534 - flaky LocalRecoveryTest.testStateSizeIsConsideredForLocalRecoveryOnRestart that intermittently times out in CI.
Root Cause: The test triggers a checkpoint immediately after setAllExecutionsToRunning() without verifying tasks have fully transitioned to RUNNING state. While state updates are
synchronous, they trigger async callbacks (checkpoint coordinator, etc.) that need time to process. In slower CI environments, the checkpoint coordinator may not have finished processing,
causing the checkpoint trigger to be rejected and waitForCheckpointInProgress() to timeout after 60 seconds.
Solution: Added waitForAllTasksRunning() utility method to ensure all task executions are in RUNNING state before triggering the checkpoint.
This follows a similar approach to #27740 (FLINK-39182) which fixed threading/timing issues in ExecutionGraphRestartTest.
Brief change log
Verifying this change
Verified locally with 300+ test iterations without failure.
Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation