internal/cli tests roughly doubled in run time with the locking change #80

Closed
opened 2026-10-04 05:01:18 +02:00 by clawbot · 1 comment
Collaborator

Since #69 (locking and atomic writes) landed, the internal/cli tests in script/cibuild take about 43s on this host, against about 24s on the commit before it under similar load. REPO_POLICIES.md asks for make test under 20 seconds. This is separate from #52, which is about -race and the large-size cases and stays sneak's decision.

Definition of done

  • Find which tests added the time (likely the ones that hold the state-directory lock and wait to show a command blocks, and the real-filesystem atomic-write tests) with a verbose test run through the repo's own entrypoints.
  • Bring internal/cli back to about its pre-locking time without weakening what the tests prove: shorter waits that still show the command is blocked (for example wait until the command is observed blocked, then release, instead of sleeping a fixed time), t.Parallel() where tests do not share state, shared fixtures. No skips, no testing.Short(), no removed cases.
  • Each changed test still fails when the defect it guards is planted back.
  • TODO.md updated in the same commit.

Model: opus-5-5

Since https://git.eeqj.de/sneak/secret/pulls/69 (locking and atomic writes) landed, the `internal/cli` tests in `script/cibuild` take about 43s on this host, against about 24s on the commit before it under similar load. `REPO_POLICIES.md` asks for `make test` under 20 seconds. This is separate from https://git.eeqj.de/sneak/secret/issues/52, which is about `-race` and the large-size cases and stays sneak's decision. ## Definition of done - Find which tests added the time (likely the ones that hold the state-directory lock and wait to show a command blocks, and the real-filesystem atomic-write tests) with a verbose test run through the repo's own entrypoints. - Bring `internal/cli` back to about its pre-locking time without weakening what the tests prove: shorter waits that still show the command is blocked (for example wait until the command is observed blocked, then release, instead of sleeping a fixed time), `t.Parallel()` where tests do not share state, shared fixtures. No skips, no `testing.Short()`, no removed cases. - Each changed test still fails when the defect it guards is planted back. - `TODO.md` updated in the same commit. Model: opus-5-5
Author
Collaborator

#83: the time came from the fixed 100 ms wait per command in the lock test and from six path and move tests each creating two vaults with passphrase unlockers. The lock test now releases the lock as soon as it sees the command waiting for it, and those vaults are created once and copied for each test.

Model: opus-5-5

https://git.eeqj.de/sneak/secret/pulls/83: the time came from the fixed 100 ms wait per command in the lock test and from six path and move tests each creating two vaults with passphrase unlockers. The lock test now releases the lock as soon as it sees the command waiting for it, and those vaults are created once and copied for each test. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/secret#80