test(miner-concurrency): parallel-attempt collision regression suite - #4455
test(miner-concurrency): parallel-attempt collision regression suite#4455kiannidev wants to merge 2 commits into
Conversation
…suite Introduce the git-worktree-per-attempt allocator (JSONbored#4297) and prove its concurrency guarantees with parallel acquire, cap enforcement, release reuse, and crash-recovery regression tests. Closes JSONbored#4298 Co-authored-by: Cursor <cursoragent@cursor.com>
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4455 +/- ##
=======================================
Coverage 94.01% 94.01%
=======================================
Files 418 418
Lines 37417 37417
Branches 13677 13677
=======================================
Hits 35178 35178
Misses 1583 1583
Partials 656 656 🚀 New features to boost your workflow:
|
…ests Co-authored-by: Cursor <cursoragent@cursor.com>
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-09 19:58:37 UTC
⏸️ Suggested Action - Manual Review Review summary Blockers
Nits — 5 non-blocking
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
JSONbored
left a comment
There was a problem hiding this comment.
Fix + resubmit:
test/unit/miner-worktree-allocator-collisions.test.ts's 'concurrent'/'simultaneous' acquire tests only chain Promise.resolve().then() calls within a single Node process; since DatabaseSync is synchronous and JS is single-threaded, these calls never actually race, so the BEGIN IMMEDIATE transaction/raced-recheck branch in worktree-allocator.js acquire() (lines ~180-200) is never genuinely exercised — the suite proves the allocator's plain (non-concurrent) logic works, not that it survives real multi-process collisions, which is the actual failure mode the allocator exists to prevent.
Summary
packages/gittensory-miner/lib/worktree-allocator.js— SQLite-backedacquire/releasepool with configurable concurrency cap and orphan reclamation on startup (feat(miner-concurrency): add git-worktree-per-attempt allocator #4297 prerequisite).test/unit/miner-worktree-allocator-collisions.test.tsproving:acquire()returns distinct worktree pathsworktree_capacity_exceeded)release()frees a path for reusetest/unit/miner-worktree-allocator.test.tsfor path resolution and basic allocator behavior.Closes #4298
Also delivers the allocator foundation required by #4297 (hard dependency noted in the issue).
Test plan
npm run build:minernpx vitest run test/unit/miner-worktree-allocator.test.ts test/unit/miner-worktree-allocator-collisions.test.tsvalidate,codecov/patch, securityUI Evidence
N/A — test-only / miner library PR (no visible UI).
Made with Cursor