Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions tests/test_supervisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,14 @@ def test_killed_child_is_restarted_and_its_task_reaped(self, tmp_path):
r"Worker process \d exited with signal SIGKILL; restarting", log
)
row = OxTask.objects.get(id=result.id)
assert row.attempts == 2
assert len(row.worker_ids) == 2
# At-least-once execution: on a slow runner the second holder can
# miss a lease renewal, the reaper hands the task back, and a third
# claim runs it. Assert what the worker promises, not an exact count.
assert row.attempts >= 2
assert len(row.worker_ids) == row.attempts
assert row.worker_ids[0] == holder
if row.attempts > 2:
assert "lost its lease" in log


class TestReinvocation:
Expand Down