(self, manager, subtests)
| 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"): |
nothing calls this directly
no test coverage detected