Skip to content

Commit 835da28

Browse files
authored
Merge pull request #2748 from graingert-coef/prevent-celery-tests-hanging-if-celery-fails-to-start
prevent celery tests hanging if celery fails to start
2 parents 18960af + c69db46 commit 835da28

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/integration/long_callback/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,19 @@ def setup_long_callback_app(manager_name, app_name):
9494
"2",
9595
"--loglevel=info",
9696
],
97+
encoding="utf8",
9798
preexec_fn=os.setpgrp,
9899
stderr=subprocess.PIPE,
99100
)
100101
# Wait for the worker to be ready, if you cancel before it is ready, the job
101102
# will still be queued.
103+
lines = []
102104
for line in iter(worker.stderr.readline, ""):
103-
if "ready" in line.decode():
105+
if "ready" in line:
104106
break
107+
lines.append(line)
108+
else:
109+
raise RuntimeError("celery failed to start: " + {"\n".join(lines)})
105110

106111
try:
107112
yield import_app(f"tests.integration.long_callback.{app_name}")

0 commit comments

Comments
 (0)