MCPcopy Create free account
hub / github.com/python-arq/arq / test_job_same_function_different_id

Function test_job_same_function_different_id

tests/test_cron.py:256–272  ·  view source on GitHub ↗

Set a different ID on the same function job, which runs at startup and ensure both functions are run. See next test for behaviour without setting job_id.

(worker)

Source from the content-addressed store, hash-verified

254
255
256async def test_job_same_function_different_id(worker):
257 """
258 Set a different ID on the same function job, which runs at startup and ensure both functions are run.
259 See next test for behaviour without setting job_id.
260 """
261 worker: Worker = worker(
262 cron_jobs=[
263 cron(foobar, minute=10, run_at_startup=True, job_id='custom_id'),
264 cron(foobar, minute=20, run_at_startup=True, job_id='custom_id2'),
265 ],
266 poll_delay=0.01,
267 )
268 await worker.main()
269
270 assert worker.jobs_complete == 2
271 assert worker.jobs_failed == 0
272 assert worker.jobs_retried == 0
273
274
275async def test_run_at_startup_no_id_only_runs_once(worker):

Callers

nothing calls this directly

Calls 3

cronFunction · 0.90
workerFunction · 0.85
mainMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…