#630

test(core): give the statefile lock test room on a slow runner (OPS-297)

Openwiiiimmwants to merge intofrom

Closes OPS-297

What

statefile::tests::the_lock_file_is_0600_and_serialises_read_modify_write failed once in the test job on #652 and passed on a rerun. The same commit passed it in debian and macos. Four threads each fsync 25 writes under the lock, and each gave up after 300 tries of 10 ms (3 s). On a slow runner with no fair schedule, one thread can wait longer than that. The test checks that no update is lost and that the lock file is 0600, not how soon a lock frees, so it now waits up to 6000 tries (60 s). The widgets' own half-second wait is unchanged.

Testing

cargo test -p opscope-core --lib statefile, three runs, all green.


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Activity

6
linear-code[bot]12d ago
chatgpt-codex-connector[bot]12d ago
Codex Review Summary: ✅ Completed

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

ReviewStatusCommitReview trigger
📝 Code Review✅ Completed 2026-11-17T02:54:13.028467Z72f0fcfPR 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.

coderabbitai[bot]12d ago

No actionable comments were generated in the recent review.

Summary by CodeRabbit

  • Tests
    • Extended the wait window in a concurrency test and clarified that it checks for lost updates. This gives the test more time to detect inconsistent results during simultaneous state-file updates. The change affects test coverage only; no end-user functionality or behaviour has changed.

Walkthrough

The lock serialisation test now allows 6,000 wait attempts of 10 ms. Its comments clarify that the test checks for lost updates, not how soon the lock is released.

Changes

Lock serialisation test

Layer / File(s)Summary
Extend the lock test wait limit
core/src/statefile.rs
The test allows up to 6,000 wait attempts instead of 300. Updated comments note that a thread may wait seconds and that the test checks for lost updates, not lock-release timing.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Possibly related PRs

Merge Risk: Minimal · up to 72f0f

This only makes a lock test more tolerant of slow CI runners and does not change production behavior. It carries no meaningful merge risk.

Security architecture risk: Minimal · up to 72f0f

The change gives a lock-serialization test more time on slow runners while preserving its permission and lost-update checks. No production behavior change is described.

Pre-merge checks: 4

Check nameStatusExplanation
Title checkThe title names the change: it adds more wait room to the statefile lock test on slow runners, and it references the ticket OPS-297. It matches the raw summary, which says the test now allows 6,000 wa…
Description checkThe description explains the flaky failure in the statefile lock test, the cause (300 tries of 10 ms, with a 3 s limit), the fix (6000 tries, 60 s), and the test that was run. This matches the raw sum…
Linked Issues checkCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkCheck skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change: it adds more wait room to the statefile lock test on slow runners, and it references the ticket OPS-297. It matches the raw summary, which says the test now allows 6,000 waits of 10 ms instead of 300. The title is a conventional test(core) commit style line and is specific enough for a reader scanning history.

Full details: Description check

Explanation

The description explains the flaky failure in the statefile lock test, the cause (300 tries of 10 ms, with a 3 s limit), the fix (6000 tries, 60 s), and the test that was run. This matches the raw summary, which reports the longer wait and the lost-update focus of the test.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Simplify code

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Usage-based review receipt

NOTE

This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.

A rabbit checks the lock once more,
And waits beyond the old count’s door.
No lost update slips past the test,
While patient paws allow the rest.
The lock may take its time to free,
The test checks what must not be.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 704d89a9-d6b0-4426-ac0d-e724fcb8a907
Commits

Reviewing files that changed from the base of the PR and between 593f1d758b5fa41109cadf9c3483f41e4c51c33e and 72f0fcfc4951f1eb2c883cd9d90ddd0ec2125f46.

Files selected for processing: 1

  • core/src/statefile.rs

Limit details: You’ve used all 2 included reviews currently available. Your 72 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Recent review details

Context from checks skipped due to timeout: 4

  • GitHub Check: CodeRabbit
  • GitHub Check: test
  • GitHub Check: macos
  • GitHub Check: debian
Additional context used

Code guidelines: 2

.agents/skills/principle-experience-first/SKILL.md — Agent Skill
.agents/skills/principle-minimize-reader-load/SKILL.md — Agent Skill
Path-based instructions: 2

Source excerpt: When implementation convenience conflicts with user delight, choose delight.

CodeRabbit inference engine (.agents/skills/principle-experience-first/SKILL.md)

Files:

  • core/src/statefile.rs
Source excerpt: **Collapse layers** that cost more than they save: wrappers with one caller, adapters with no second implementation, speculative indirection that was never needed.

CodeRabbit inference engine (.agents/skills/principle-minimize-reader-load/SKILL.md)

Files:

  • core/src/statefile.rs

coderabbitai[bot]approved changes12d ago