django-tasks-scheduler icon indicating copy to clipboard operation
django-tasks-scheduler copied to clipboard

Intermittent failure: test_stop_job_command__success on py3.11/dj5.2.5/fakeredis job

Open DhavalGojiya opened this issue 2 months ago • 1 comments

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

job-log (see attached CI screenshot for failure)


Environment

  • OS: Ubuntu (GitHub Actions)
  • Python: 3.11
  • Django: 5.2.5
  • Redis: fakeredis backend

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.

DhavalGojiya avatar Oct 16 '25 05:10 DhavalGojiya

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.

DhavalGojiya avatar Oct 23 '25 13:10 DhavalGojiya