test(agent): periodic-scheduler worker-start-failure test exercises the failure branch again (follow-up #106308) - #106328
Merged
kshitijk4poor merged 1 commit intoSep 9, 2026
Conversation
…rker again
`kwargs.get("target") is sched._run_callback` is always False (a bound method is a fresh object
per access), so the fake never returned Boom and the _dispatch failure branch went untested;
the test passed on the normal worker. Compare with == and assert the interception happened
(mutation: retiring the handle on start failure now fails the test).
The thread-count assertions sampled while per-fire workers were still live; quiesce every
handle with cancel(wait=) before sampling so the count is deterministic (AGENTS.md: timing tests
must not assume a quiet runner).
Follow-up to NousResearch#106308.
kshitijk4poor
enabled auto-merge (rebase)
September 9, 2026 07:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #106308 (salvage of #105716). The post-merge review pass found the salvage's own test rewrite had gone vacuous.
tests/agent/test_periodic_scheduler.py::test_worker_start_failure_keeps_timer: the fake matched the worker withkwargs.get("target") is sched._run_callback; a bound method is a fresh object per access, so it never matched, the failure branch in_dispatchwas never driven, and the test passed on the normal worker. Now==, plus an assertion that the interception happened once.threading.active_count()while per-fire workers could still be alive (the mechanism fix(agent): one blocked periodic callback no longer stalls lease refresh and liveness timers (#102574; salvage #105716, same mechanism as #102458) #106308 introduced); every handle is quiesced withcancel(wait=)before sampling.Validation: 6 passed ×3; mutation (retire the handle on worker-start failure) →
worker-start failure silently retired the timer. No production change.