This is an automated email from the ASF dual-hosted git repository.
eladkal pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 69ee7a3b7fc Fix flaky
test_adjust_maintenance_mode_based_on_sysinfo_exit (#69738)
69ee7a3b7fc is described below
commit 69ee7a3b7fc80824d75ba365a4787060a9bdf090
Author: PoAn Yang <[email protected]>
AuthorDate: Tue Jul 14 23:31:29 2026 +0900
Fix flaky test_adjust_maintenance_mode_based_on_sysinfo_exit (#69738)
Signed-off-by: PoAn Yang <[email protected]>
---
providers/edge3/tests/unit/edge3/cli/test_worker.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/providers/edge3/tests/unit/edge3/cli/test_worker.py
b/providers/edge3/tests/unit/edge3/cli/test_worker.py
index bbbf2690faf..0e292a7b038 100644
--- a/providers/edge3/tests/unit/edge3/cli/test_worker.py
+++ b/providers/edge3/tests/unit/edge3/cli/test_worker.py
@@ -164,6 +164,18 @@ class TestEdgeWorker:
importlib.reload(cli_parser)
self.parser = cli_parser.get_parser()
+ @pytest.fixture(autouse=True)
+ def reset_maintenance_state(self):
+ # EdgeWorker keeps runtime state in class attributes and some tests
set them
+ # on class level. Reset before each test so state does not leak
between tests.
+ EdgeWorker.maintenance_mode = False
+ EdgeWorker.maintenance_comments = None
+ try:
+ yield
+ finally:
+ EdgeWorker.maintenance_mode = False
+ EdgeWorker.maintenance_comments = None
+
@pytest.fixture
def cli_worker_with_team(self, tmp_path: Path) -> EdgeWorker:
test_worker = EdgeWorker(str(tmp_path / "mock.pid"), "mock", None, 8,
team_name="team_a")