MCPcopy
hub / github.com/celery/celery / test_group_children_with_callbacks

Method test_group_children_with_callbacks

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

Source from the content-addressed store, hash-verified

1454 redis_connection.delete(redis_key)
1455
1456 def test_group_children_with_callbacks(self, manager, subtests):
1457 if not manager.app.conf.result_backend.startswith("redis"):
1458 raise pytest.skip("Requires redis result backend.")
1459 redis_connection = get_redis_connection()
1460
1461 redis_key = str(uuid.uuid4())
1462 callback = redis_count.si(redis_key=redis_key)
1463
1464 child_task_count = 42
1465 child_sig = identity.si(1337)
1466 child_sig.link(callback)
1467 group_sig = group(child_sig for _ in range(child_task_count))
1468
1469 redis_connection.delete(redis_key)
1470 with subtests.test(msg="Chain executes as expected"):
1471 res_obj = group_sig()
1472 assert res_obj.get(timeout=TIMEOUT) == [1337] * child_task_count
1473 with subtests.test(msg="Chain child task callbacks are called"):
1474 await_redis_count(child_task_count, redis_key=redis_key)
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"):

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected