我是芹菜任務的單元測試。 我有鏈式任務也有組,所以會產生和絃。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被永久重試。 我對任務結果不感興趣。 如何等待所有子任務完成?