Skip to content

fix: let the killed-child supervisor test accept lease-loss retries - #49

Merged
PhiLily merged 1 commit into
oxpull:mainfrom
dydydd:fix/flaky-killed-child-attempts
Sep 17, 2026
Merged

PhiLily merged 1 commit into
oxpull:mainfrom
dydydd:fix/flaky-killed-child-attempts

Conversation

@dydydd

@dydydd dydydd commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

The exact attempts == 2 assertion breaks on busy CI runners: with --lock-timeout 0.5, the second holder can miss a lease renewal, the reaper hands the task back, and a third claim runs it — at-least-once semantics doing their job (stale result refused via "lost its lease", task ends SUCCESSFUL).

Asserts what the worker promises instead of an exact count: attempts >= 2, one worker id per attempt, first holder unchanged, and lost its lease in the log when a third attempt happens. Kept the SIGKILL-restart and final-status checks untouched, per #47.

Verified: targeted test + full tests/test_supervisor.py (25 passed) on Python 3.13 / SQLite; ruff check and ruff format --check clean. Full suite: 1066 passed, 1 pre-existing failure in test_import_beat (zoneinfo translation) that reproduces on a clean checkout here, unrelated to this change.

Closes #47

On a busy CI runner the second holder can miss a lease renewal with
--lock-timeout 0.5, the reaper hands the task back, and a third claim
runs it -- at-least-once execution doing its job: the stale run is
refused (lost its lease) and the task still ends SUCCESSFUL.

Assert what the worker promises instead of an exact count: attempts
>= 2, one worker id per attempt, the first holder unchanged, and the
lease-loss log line when a third attempt happens.

Closes oxpull#47
@PhiLily
PhiLily merged commit aac3b38 into oxpull:main Sep 17, 2026
30 checks passed
@PhiLily

PhiLily commented Sep 17, 2026

Copy link
Copy Markdown
Member

Thank you @dydydd ! great work looking forward to seeing you around again :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Let the killed-child supervisor test allow more than two attempts

2 participants