Skip to content

[FLINK-40682][tests] Fix unstable ArchivedExecutionGraphTest - #29208

Open
SEPURI-SAI-KRISHNA wants to merge 1 commit into
apache:masterfrom
SEPURI-SAI-KRISHNA:archived-eg-flaky
Open

SEPURI-SAI-KRISHNA wants to merge 1 commit into
apache:masterfrom
SEPURI-SAI-KRISHNA:archived-eg-flaky

Conversation

@SEPURI-SAI-KRISHNA

Copy link
Copy Markdown
Contributor

What is the purpose of the change

ArchivedExecutionGraphTest sometimes errors in @BeforeAll with BUG: trying to schedule a region which is not in CREATED state. The scheduler runs on forMainThread() but gets a real future executor, so Execution#deploy() hands back to the main-thread executor from that executor's thread and the thread assertion throws. Normally that error is lost in the future chain. When the test thread attaches whenCompleteAsync after it, the callback runs inline, fails v1 with the AssertionError, and the job cancels the regions startScheduling() has not reached yet. The CI log of the failing run shows v1 going from DEPLOYING to FAILED with java.lang.AssertionError right before the error.

Brief change log

  • Have the class executor extension create a DirectScheduledExecutorService, so the deployment callbacks run inline on the test thread. The extension still shuts it down. FLINK-38536 used the same executor for FinalizeOnMasterTest and ExecutionGraphFinishTest.

Verifying this change

  • With TDD creation delayed on the executor and deploy() delayed before whenCompleteAsync, the old test fails every run with the CI error (12 of 12), and the new test passes every run (5 of 5) with no main thread violations.
  • Delaying only TDD creation, the old test passes 5 of 5, so both orderings are needed.
  • Breaking the FAILING timestamp or the job state in ArchivedExecutionGraph#createFrom still fails testArchive.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Claude Code (Opus 5)

@flinkbot

flinkbot commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants