Skip to content

test: shrink the concurrency harness to the scale this tool is actually used at - #30

Merged
d6veteran merged 1 commit into
mainfrom
claude/trim-concurrency-tests
Jul 30, 2026
Merged

test: shrink the concurrency harness to the scale this tool is actually used at#30
d6veteran merged 1 commit into
mainfrom
claude/trim-concurrency-tests

Conversation

@d6veteran

Copy link
Copy Markdown
Collaborator

Tests only. No code touched.

The concurrency block was a 12-writer storm against a planted stale lock with CPU pressure across eight throwaway repos. It was built to prove the locking rewrite under hostile conditions. It did that, then cost 113 lines and about a third of the suite's runtime on every run afterwards.

Realistic usage is two or three parallel sessions. Now three concurrent writers against the branch index and three pairs against CLAUDE.md, in 45 lines.

Before After
Runtime 16.8s 12.1s
Tests 269 258
tests/run.sh 1637 lines 1569

What this trades away

Stated plainly, because it is a real loss: with the lock neutered, the trimmed block still fails, but only on the CLAUDE.md duplicate-block assertion. Three writers is not enough to reproduce the lost index row that twelve reproduced reliably.

So this is a weaker detector of the same bug, not an equivalent one. Verified by disabling lock_acquire and running it.

The lock implementation is unchanged, and the deterministic tests covering it directly are untouched: liveness outranking the age rule, an ancient lock held by a live PID not being broken, and the takeover leaving no directory behind.

One thing I tried and reverted

Shrinking the 8 MB fixture in the SIGINT test. It saved nothing measurable (11.6s vs 11.7s, noise), and a smaller file narrows the window the signal has to land in — the exact flake that failed on macOS earlier today. Reverted.

Scope honesty

I estimated ~240 lines out. Actual is 68. The other blocks I flagged as candidates turned out to be deterministic and fast, so cutting them would have removed coverage for no runtime gain.


Generated by Claude Code

…ly used at

The shared-state concurrency block was a 12-writer storm against a planted stale
lock with CPU pressure, spread over eight throwaway repos. It was built to prove
the locking rewrite under hostile conditions, it did that, and then it cost 113
lines and roughly a third of the suite's runtime on every run afterwards.

The realistic case is two or three parallel sessions. The block now runs three
concurrent writers against the branch index and three pairs against CLAUDE.md,
in 45 lines.

What that trades away, stated plainly: with the lock neutered, the trimmed block
still fails, but only on the CLAUDE.md duplicate-block assertion. Three writers
is not enough to reproduce the lost index row that twelve reproduced reliably. So
this is a weaker detector of the same bug, not an equivalent one. The lock
implementation in bin/claude-team is unchanged, and the deterministic tests that
cover it directly, liveness outranking the age rule and the takeover leaving no
directory behind, are untouched.

Runtime 16.8s to 12.1s. 269 tests to 258. tests/run.sh 1637 lines to 1569.

I also tried shrinking the 8 MB fixture in the SIGINT test and reverted it: it
saved nothing measurable, and a smaller file narrows the window the signal has to
land in, which is the exact flake that failed on macOS earlier.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019j5DHEZsoeCGRueTbNLuTb
@d6veteran
d6veteran marked this pull request as ready for review July 30, 2026 22:18
@d6veteran
d6veteran merged commit 7400b82 into main Jul 30, 2026
3 checks passed
@d6veteran
d6veteran deleted the claude/trim-concurrency-tests branch July 30, 2026 22:26
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