(arq_redis: ArqRedis, worker, caplog)
| 785 | |
| 786 | |
| 787 | async def test_max_bursts_multiple(arq_redis: ArqRedis, worker, caplog): |
| 788 | async def foo(ctx, v): |
| 789 | return v + 1 |
| 790 | |
| 791 | caplog.set_level(logging.INFO) |
| 792 | await arq_redis.enqueue_job('foo', 1) |
| 793 | await arq_redis.enqueue_job('foo', 2) |
| 794 | worker: Worker = worker(functions=[func(foo, name='foo')]) |
| 795 | assert await worker.run_check(max_burst_jobs=1) == 1 |
| 796 | assert worker.jobs_complete == 1 |
| 797 | assert worker.jobs_retried == 0 |
| 798 | assert worker.jobs_failed == 0 |
| 799 | # either foo(1) or foo(2) can be run, but not both |
| 800 | if 'foo(1)' in caplog.text: |
| 801 | assert 'foo(2)' not in caplog.text |
| 802 | else: |
| 803 | assert 'foo(2)' in caplog.text |
| 804 | assert 'foo(1)' not in caplog.text |
| 805 | |
| 806 | |
| 807 | async def test_max_bursts_dont_get(arq_redis: ArqRedis, worker): |
nothing calls this directly
no test coverage detected
searching dependent graphs…