Skip to content

Sonny triggers test: a lock just dropped may still be held a moment - #454

Merged
lydakis merged 8 commits into
mainfrom
claude/project-thread-u2fp8q
Oct 30, 2026
Merged

lydakis merged 8 commits into
mainfrom
claude/project-thread-u2fp8q

Conversation

@lydakis

@lydakis lydakis commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

🤖 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 at trigger.rs:4848 with left: 0, right: 1. That means forget_done returned 0 right after the test dropped the lock it held for the step before.

try_take is 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. flock belongs 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.rs uses env_clear with 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_done is 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).

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
…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
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
@lydakis lydakis self-assigned this Oct 30, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T07:19:47.729524Z 8216e5e PR opened
🔒 Security Review ✅ Completed 2026-10-30T07:20:25.911834Z 8216e5e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lydakis
lydakis merged commit 079799f into main Oct 30, 2026
4 checks passed
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.

2 participants