Skip to content

Follow-up from #2034 review: cover configured busy timeout in SpeakerDatabaseSnapshotTests #2145

Closed

Description

@r3dbars

Minor Codex review findings from #2034, deferred so the PR can merge.

  • SpeakerDatabaseSnapshotTests should verify busyTimeout is honored via an injected clock/deadline, not the fixed 5s cap. (thread)

Activity

  1. added
    waiting-on-humanNeeds a human (Justin) to look before anything else happens
    cleanupOne-time repo cleanup
    on Oct 8, 2026
  2. r3dbars commented on Oct 17, 2026

    @r3dbars
    OwnerAuthor

    Already fixed on main by 78d7a18 ("Prove snapshot busy timeout with an injected clock", landed via #2173).

    SpeakerDatabaseSnapshot.create now takes injected now/wait closures, and testExclusiveLockFailsWithBusyAndPreservesSource passes busyTimeout: 0.05 with a fake monotonic clock. It asserts the simulated time ends at 0.05 (±1e-6), exactly 5 waits each in (0, 0.01], a .busy error, unchanged source bytes, and no destination file. No wall-clock timing.

    Checked on current origin/main:

    • swift test --filter SpeakerDatabaseSnapshotTests in Tools/TranscriptedCLI: 7 tests, 0 failures.
    • Mutation check: forcing the deadline to the fixed 5s cap (ignoring busyTimeout) makes the test fail (simulated time 5.0 vs 0.05, 501 waits vs 5). Reverted after.

    So the promise from the #2034 review thread is covered. Closing.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    cleanupOne-time repo cleanupwaiting-on-humanNeeds a human (Justin) to look before anything else happens

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions