Repository navigation
Sonny triggers test: a lock just dropped may still be held a moment - #454
Merged
Merged
Conversation
A one-off, or a `--runs` trigger's last run, deleted its state row as soon as its message went out, so a turn that failed afterwards (offline, a login expired) left nothing for /background, the footer's count or the triggers tool to show. Its row now stays, and whoever asks the daemon how its turn ended removes it once that turn completed with any answer passed on; a failed one stays until removed, as systemd keeps a failed unit until reset-failed. Fixes #422. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEbQZnXUy1kATtYcQ6
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEbQZnXUy1kATtYcQ6
…to claude/project-thread-u2fp8q
…ample The eval of #433 showed leads setting the look as a one-off `at` (3 of 4), with no if command (4 of 4), and one under the wrong name. A one-off whose if command says no ends, so a skipped look was gone. lead.md now says the look repeats (every, or cron for a set hour), never at or in, gives the skip-while-writing check as a command, names it by example (web.lead.next for web.lead), and says the next setting uses replace. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEbQZnXUy1kATtYcQ6
…to claude/project-thread-u2fp8q
a_fire_ends_only_the_trigger_it_ran_for failed once on macOS (#380's run): forget_done returned 0 right after the test dropped the lock it held. flock belongs to the open file, and a process another test forks shares it until it execs, so the lock can stay taken a moment after the drop. forget_done is built for that (Sonny's window tries again on its next refresh), so the test now tries again for up to five seconds, as the window would. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEbQZnXUy1kATtYcQ6
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
🤖 Generated with Claude Code
What
trigger::tests::a_fire_ends_only_the_trigger_it_ran_for, the test changed in #442, failed once on macOS in #380's run, attempt 1 of job 123935932029. It failed attrigger.rs:4848withleft: 0, right: 1. That meansforget_donereturned 0 right after the test dropped the lock it held for the step before.try_takeis the only step in that path that can behave differently from one run to the next. Everything else reads files in the test's own temp folder.flockbelongs to the open file, so a process that another test forks shares that file until it execs. Sonny's tests spawn processes concurrently; for example,main.rsusesenv_clearwith a program path, which is the fork-then-exec path. So the lock can stay taken for a moment after the drop. This cause is inferred, not reproduced. The file and the order of steps can't otherwise differ between runs.forget_doneis built for this case. Sonny's window does not wait for a lock someone else holds, and tries again on its next refresh (#442). So the code needs no change. The test now tries again for up to five seconds, the way the window would. All its other assertions are unchanged.Checks
cargo fmt --check,cargo clippy -p sonny --all-targets -D warnings, and the test pass locally (Linux).