我是芹菜任务的单元测试。 我有链式任务也有组,所以会产生和弦。Python芹菜 - 如何等待所有子任务的和弦
测试应该是这样的:
- 运行芹菜任务(延迟)
- 等待任务和全部任务
- 断言
我试过如下:
def wait_for_result(result):
result.get()
for child in result.children or list():
if isinstance(child, GroupResult):
# tried looping over task result in group
# until tasks are ready, but without success
pass
wait_for_result(child)
这创建了一个de adlock,chord_unlock被永久重试。 我对任务结果不感兴趣。 如何等待所有子任务完成?