Skip to content

Commit 3466998

Browse files
committed
Wait for worker to be ready.
1 parent 050b85e commit 3466998

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/integration/long_callback/test_basic_long_callback.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,14 @@ def setup_long_callback_app(manager_name, app_name):
6262
"--loglevel=info",
6363
],
6464
preexec_fn=os.setpgrp,
65+
stderr=subprocess.PIPE,
6566
)
6667
# Wait for the worker to be ready, if you cancel before it is ready, the job
6768
# will still be queued.
68-
time.sleep(1)
69+
for line in iter(worker.stderr.readline, ""):
70+
if "ready" in line.decode():
71+
break
72+
6973
try:
7074
yield import_app(f"tests.integration.long_callback.{app_name}")
7175
finally:

0 commit comments

Comments
 (0)