This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch v3-3-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-3-test by this push:
new 226c44782b4 [v3-3-test] Make test_cli_run_time tolerant of slow/cold
CI runners (#68968) (#69053)
226c44782b4 is described below
commit 226c44782b467db743aba2cce5fb432f0bd33e15
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Jun 26 16:06:05 2026 -0400
[v3-3-test] Make test_cli_run_time tolerant of slow/cold CI runners
(#68968) (#69053)
The test asserted the best of 3 "airflow --help" startup samples was under a
tight 5s bound. On a loaded or cold runner (e.g. the Pendulum2 special-test
job,
which runs in a freshly rebuilt env) the whole-provider-load startup
consistently
sits just over it -- the best of 3 was 5.49s -- even though nothing
regressed.
Take the min of more samples and loosen the threshold so the test still
guards
against gross startup regressions without flaking on small fluctuations.
(cherry picked from commit b24194f48d991b0b6c892092f07c149cf768a783)
Co-authored-by: Jarek Potiuk <[email protected]>
---
airflow-core/tests/unit/cli/test_cli_parser.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/airflow-core/tests/unit/cli/test_cli_parser.py
b/airflow-core/tests/unit/cli/test_cli_parser.py
index c4d8a95f008..acba2fa5d2e 100644
--- a/airflow-core/tests/unit/cli/test_cli_parser.py
+++ b/airflow-core/tests/unit/cli/test_cli_parser.py
@@ -629,12 +629,14 @@ class TestCliSubprocess:
# Warm-up run
subprocess.run(command, env=env, capture_output=True, check=False)
- # Limit the number of samples otherwise the test will take a very long
time
- num_samples = 3
- threshold = 5
+ # Take the min across several samples to measure best-case startup and
tolerate transient CI
+ # slowness; keep the count bounded so the test does not take a very
long time. The threshold is
+ # deliberately loose -- this guards against gross startup regressions,
not small fluctuations,
+ # and a tight bound flakes on loaded/cold runners (e.g. the Pendulum2
special-test job).
+ num_samples = 5
+ threshold = 8
raw_times = timeit.repeat(stmt=timing_code, setup=setup_code,
number=1, repeat=num_samples)
timing_result = min(raw_times)
- # Minimum run time of Airflow CLI should at least be within 5s
assert timing_result < threshold
def test_airflow_config_contains_providers(self):