aaron-y-chen commented on code in PR #74292:
URL: https://github.com/apache/airflow/pull/74292#discussion_r4188097076


##########
airflow-core/tests/unit/executors/test_local_executor.py:
##########
@@ -922,16 +922,22 @@ def 
test_actual_worker_death_after_start_releases_slot(self, start_method, kind,
         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)

Review Comment:
   Nice suggestion! Added it, thanks!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to