MCPcopy
hub / github.com/celery/celery / test_chain_children_with_callbacks

Method test_chain_children_with_callbacks

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

Source from the content-addressed store, hash-verified

686 r.get(timeout=TIMEOUT)
687
688 def test_chain_children_with_callbacks(self, manager, subtests):
689 if not manager.app.conf.result_backend.startswith("redis"):
690 raise pytest.skip("Requires redis result backend.")
691 redis_connection = get_redis_connection()
692
693 redis_key = str(uuid.uuid4())
694 callback = redis_count.si(redis_key=redis_key)
695
696 child_task_count = 42
697 child_sig = identity.si(1337)
698 child_sig.link(callback)
699 chain_sig = chain(child_sig for _ in range(child_task_count))
700
701 redis_connection.delete(redis_key)
702 with subtests.test(msg="Chain executes as expected"):
703 res_obj = chain_sig()
704 assert res_obj.get(timeout=TIMEOUT) == 1337
705 with subtests.test(msg="Chain child task callbacks are called"):
706 await_redis_count(child_task_count, redis_key=redis_key)
707 redis_connection.delete(redis_key)
708
709 def test_chain_children_with_errbacks(self, manager, subtests):
710 if not manager.app.conf.result_backend.startswith("redis"):

Callers

nothing calls this directly

Calls 8

chainClass · 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