MCPcopy
hub / github.com/celery/celery / test_group_children_with_errbacks

Method test_group_children_with_errbacks

t/integration/test_canvas.py:1477–1497  ·  view source on GitHub ↗
(self, manager, subtests)

Source from the content-addressed store, hash-verified

1475 redis_connection.delete(redis_key)
1476
1477 def test_group_children_with_errbacks(self, manager, subtests):
1478 if not manager.app.conf.result_backend.startswith("redis"):
1479 raise pytest.skip("Requires redis result backend.")
1480 redis_connection = get_redis_connection()
1481
1482 redis_key = str(uuid.uuid4())
1483 errback = redis_count.si(redis_key=redis_key)
1484
1485 child_task_count = 42
1486 child_sig = fail.si()
1487 child_sig.link_error(errback)
1488 group_sig = group(child_sig for _ in range(child_task_count))
1489
1490 redis_connection.delete(redis_key)
1491 with subtests.test(msg="Chain fails due to a child task dying"):
1492 res_obj = group_sig()
1493 with pytest.raises(ExpectedException):
1494 res_obj.get(timeout=TIMEOUT)
1495 with subtests.test(msg="Chain child task errbacks are called"):
1496 await_redis_count(child_task_count, redis_key=redis_key)
1497 redis_connection.delete(redis_key)
1498
1499 def test_group_with_callback_child_replaced(self, manager, subtests):
1500 if not manager.app.conf.result_backend.startswith("redis"):

Callers

nothing calls this directly

Calls 9

groupClass · 0.90
get_redis_connectionFunction · 0.85
await_redis_countFunction · 0.85
siMethod · 0.80
testMethod · 0.80
link_errorMethod · 0.45
deleteMethod · 0.45
raisesMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected