MCPcopy
hub / github.com/celery/celery / test_callback_called_by_group

Method test_callback_called_by_group

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

Source from the content-addressed store, hash-verified

1370 raise expected_excinfo.value
1371
1372 def test_callback_called_by_group(self, manager, subtests):
1373 if not manager.app.conf.result_backend.startswith("redis"):
1374 raise pytest.skip("Requires redis result backend.")
1375 redis_connection = get_redis_connection()
1376
1377 callback_msg = str(uuid.uuid4()).encode()
1378 redis_key = str(uuid.uuid4())
1379 callback = redis_echo.si(callback_msg, redis_key=redis_key)
1380
1381 group_sig = group(identity.si(42), identity.si(1337))
1382 group_sig.link(callback)
1383 redis_connection.delete(redis_key)
1384 with subtests.test(msg="Group result is returned"):
1385 res = group_sig.delay()
1386 assert res.get(timeout=TIMEOUT) == [42, 1337]
1387 with subtests.test(msg="Callback is called after group is completed"):
1388 await_redis_echo({callback_msg, }, redis_key=redis_key)
1389 redis_connection.delete(redis_key)
1390
1391 def test_errback_called_by_group_fail_first(self, manager, subtests):
1392 if not manager.app.conf.result_backend.startswith("redis"):

Callers

nothing calls this directly

Calls 10

groupClass · 0.90
get_redis_connectionFunction · 0.85
await_redis_echoFunction · 0.85
siMethod · 0.80
testMethod · 0.80
encodeMethod · 0.45
linkMethod · 0.45
deleteMethod · 0.45
delayMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected