This is an automated email from the ASF dual-hosted git repository.
shahar1 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 0c1fa8eeb72 Keep a Breeze test's --dry-run from leaking into later
tests (#75589)
0c1fa8eeb72 is described below
commit 0c1fa8eeb726df9483a64c9a0597d3c36ddad040
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sun Oct 25 05:17:05 2026 +0100
Keep a Breeze test's --dry-run from leaking into later tests (#75589)
The dry-run, verbose and forced-answer options are process-wide, so a
test invoking a command with --dry-run made run_command return empty
output for every later test on the same xdist worker. Which tests failed
depended on how xdist distributed them, so the Breeze unit tests failed
intermittently, as in the scheduled ARM run.
Generated-by: Claude Opus 5
---
dev/breeze/tests/conftest.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/dev/breeze/tests/conftest.py b/dev/breeze/tests/conftest.py
index 57d834359c6..c7cfcd5fa5b 100644
--- a/dev/breeze/tests/conftest.py
+++ b/dev/breeze/tests/conftest.py
@@ -21,6 +21,7 @@ from pathlib import Path
import pytest
from airflow_breeze.utils.functools_cache import clear_all_cached_functions
+from airflow_breeze.utils.shared_options import _SharedOptions
def pytest_configure(config):
@@ -86,3 +87,11 @@ def make_worktree(tmp_path):
return path
return make
+
+
[email protected](autouse=True)
+def restore_shared_options(monkeypatch):
+ # Invoking a command with --dry-run or --verbose sets these for the whole
process, so later tests
+ # on the same xdist worker would run with them, and run_command would
return empty output.
+ for name in ("verbose_value", "dry_run_value", "forced_answer"):
+ monkeypatch.setattr(_SharedOptions, name, getattr(_SharedOptions,
name))