MCPcopy Create free account
hub / github.com/celery/celery / test_accept

Method test_accept

t/integration/test_serialization.py:10–27  ·  view source on GitHub ↗
(self, celery_app)

Source from the content-addressed store, hash-verified

8
9class test_config_serialization:
10 def test_accept(self, celery_app):
11 app = celery_app
12 # Redefine env to use in subprocess
13 # broker_url and result backend are different for each integration test backend
14 passenv = {
15 **os.environ,
16 "CELERY_BROKER_URL": app.conf.broker_url,
17 "CELERY_RESULT_BACKEND": app.conf.result_backend,
18 }
19 with ThreadPoolExecutor(max_workers=2) as executor:
20 f1 = executor.submit(get_worker_error_messages, "w1", passenv)
21 f2 = executor.submit(get_worker_error_messages, "w2", passenv)
22 time.sleep(3)
23 log1 = f1.result()
24 log2 = f2.result()
25
26 for log in [log1, log2]:
27 assert log.find(disabled_error_message) == -1, log
28
29
30def get_worker_error_messages(name, env):

Callers

nothing calls this directly

Calls 3

findMethod · 0.80
sleepMethod · 0.45
resultMethod · 0.45

Tested by

no test coverage detected