This is an automated email from the ASF dual-hosted git repository.
potiuk 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 9c1bb68c41f Increase worker startup timeout in LocalExecutor process
death test (#74292)
9c1bb68c41f is described below
commit 9c1bb68c41f42333b43e1965d2dce4c0ed9ceecc
Author: Aaron Chen <[email protected]>
AuthorDate: Mon Oct 5 15:33:37 2026 -0700
Increase worker startup timeout in LocalExecutor process death test (#74292)
* Increase worker startup timeout in LocalExecutor process death test
* Reduce worker process startup timeout and improve error message clarity
in LocalExecutor tests
* Add assertion to verify worker process exits after being killed in
LocalExecutor tests
---
airflow-core/tests/unit/executors/test_local_executor.py | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/airflow-core/tests/unit/executors/test_local_executor.py
b/airflow-core/tests/unit/executors/test_local_executor.py
index b5213b3c640..2c6e1d15484 100644
--- a/airflow-core/tests/unit/executors/test_local_executor.py
+++ b/airflow-core/tests/unit/executors/test_local_executor.py
@@ -900,7 +900,7 @@ class TestLocalExecutorBookkeeping:
@pytest.mark.parametrize("start_method", ["fork", "spawn"])
@pytest.mark.parametrize("kind", ["task", "callback", "connection"])
- @pytest.mark.execution_timeout(30)
+ @pytest.mark.execution_timeout(60)
def test_actual_worker_death_after_start_releases_slot(self, start_method,
kind, mocker, tmp_path):
ctx = multiprocessing.get_context(start_method)
mocker.patch.object(
@@ -922,16 +922,23 @@ class TestLocalExecutorBookkeeping:
executor.queue_workload(workload,
session=mock.create_autospec(Session, instance=True))
try:
executor.heartbeat()
- deadline = time.monotonic() + 10
+ # Spawned workers re-import the airflow stack before dequeuing;
~10s observed on loaded CI runners.
+ timeout = 30
+ deadline = time.monotonic() + timeout
while not marker.exists():
- assert time.monotonic() < deadline
+ assert time.monotonic() < deadline, f"Worker process failed to
start within {timeout}s"
+ assert any(proc.is_alive() for proc in
executor.workers.values()), (
+ "Worker died before entering workload: "
+ f"{[proc.exitcode for proc in executor.workers.values()]}"
+ )
executor.sync()
time.sleep(0.01)
executor.sync()
pid, proc = next(iter(executor.workers.items()))
assert executor._worker_tasks == {pid: key}
proc.kill()
- proc.join(timeout=1)
+ proc.join(timeout=5)
+ assert not proc.is_alive(), "Worker did not exit after being
killed"
executor.sync()