Skip to content

Fix flaky test_adjust_maintenance_mode_based_on_sysinfo_exit#69738

Open
FrankYang0529 wants to merge 1 commit into
apache:mainfrom
FrankYang0529:airflow-flaky-test_adjust_maintenance_mode_based_on_sysinfo_exit
Open

Fix flaky test_adjust_maintenance_mode_based_on_sysinfo_exit#69738
FrankYang0529 wants to merge 1 commit into
apache:mainfrom
FrankYang0529:airflow-flaky-test_adjust_maintenance_mode_based_on_sysinfo_exit

Conversation

@FrankYang0529

Copy link
Copy Markdown
Member

Why

  • EdgeWorker.maintenance_mode / maintenance_comments are class attributes. The test_heartbeat set EdgeWorker.maintenance_mode = True on class level and doesn't cleanup.
  • CI runs provider unit tests with pytest -n auto, so test order is dynamic.
  • If test_heartbeat runs right before test_adjust_maintenance_mode_based_on_sysinfo_exit, the leaked True makes test_adjust_maintenance_mode_based_on_sysinfo_exit fail.

How

  • Add an autouse reset_maintenance_state fixture to TestEdgeWorker that resets EdgeWorker.maintenance_mode / EdgeWorker.maintenance_comments before each test, and after it.

Sample Failed Run


Was generative AI tooling used to co-author this PR?
  • Yes - Claude Code

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

Signed-off-by: PoAn Yang <payang@apache.org>
@boring-cyborg boring-cyborg Bot added area:providers provider:edge Edge Executor / Worker (AIP-69) / edge3 labels Jul 11, 2026
@FrankYang0529 FrankYang0529 marked this pull request as ready for review July 11, 2026 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:edge Edge Executor / Worker (AIP-69) / edge3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants