Intermittent failure: test_stop_job_command__success on py3.11/dj5.2.5/fakeredis job
Describe the bug
test_stop_job_command__success intermittently fails during the Tests py3.11/dj5.2.5/fakeredis job.
Expected worker.current_job_name to be None, but it remains set (e.g. 'default::20251015192502233773').
To Reproduce
Run tests under the any matrix job:
Ex: py3.11 / dj5.2.5 / fakeredis
- occasionally fails with:
AssertionError: 'default::20251015192502233773' is not None
Expected behavior
worker.current_job_name should be cleared (None) after stopping the job.
Screenshots
(see attached CI screenshot for failure)
Environment
- OS: Ubuntu (GitHub Actions)
- Python: 3.11
- Django: 5.2.5
- Redis:
fakeredisbackend
Additional context
This test fails intermittently - possibly a race condition in the worker’s stop_job() cleanup logic.
Adding a small delay or verifying thread shutdown may stabilize it.
Unable to reproduce this issue locally via act.
Note: We can consider moving t.join() above the assertions.
This ensures that the thread completes its execution before the assertions are evaluated.