MCPcopy
hub / github.com/celery/celery / test_chain_children_with_errbacks

Method test_chain_children_with_errbacks

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

Source from the content-addressed store, hash-verified

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"):
711 raise pytest.skip("Requires redis result backend.")
712 redis_connection = get_redis_connection()
713
714 redis_key = str(uuid.uuid4())
715 errback = redis_count.si(redis_key=redis_key)
716
717 child_task_count = 42
718 child_sig = fail.si()
719 child_sig.link_error(errback)
720 chain_sig = chain(child_sig for _ in range(child_task_count))
721
722 redis_connection.delete(redis_key)
723 with subtests.test(msg="Chain fails due to a child task dying"):
724 res_obj = chain_sig()
725 with pytest.raises(ExpectedException):
726 res_obj.get(timeout=TIMEOUT)
727 with subtests.test(msg="Chain child task errbacks are called"):
728 # Only the first child task gets a change to run and fail
729 await_redis_count(1, redis_key=redis_key)
730 redis_connection.delete(redis_key)
731
732 def test_chain_with_callback_child_replaced(self, manager, subtests):
733 if not manager.app.conf.result_backend.startswith("redis"):

Callers

nothing calls this directly

Calls 9

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