Commit graph

6 commits

Author SHA1 Message Date
matt wilkie
234da63193
fix: resolve remaining 11 CI test failures (#2983)
* fix: resolve remaining 11 CI test failures (#2982)

Two categories of fixes:

1. Flock contention in test setup helpers: bdCreate, bdCreateSilent,
   bdUpdate, bdDelete, bdClose, and bdDepAdd now retry up to 5 times
   with exponential backoff when they encounter "one writer at a time"
   flock errors. This handles transient contention when parallel tests
   within the same CI shard compete for the embedded Dolt lock during
   their setup phase.

2. macOS path symlink mismatch: TestContext* tests in
   explicit_db_nodb_test.go now use filepath.EvalSymlinks() when
   comparing beads_dir paths, fixing failures where macOS resolves
   /var/folders to /private/var/folders.

Fixes #2982

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: increase flock retry budget and add retry to read helpers

The initial 5-retry/100ms-base backoff was insufficient for CI
contention. Refactored to a shared bdRunWithFlockRetry helper with
10 retries and 500ms base backoff (~30s total budget).

Also added flock retry to bdDiff, bdDiffJSON, bdShowRaw, and
bdShowDetails which were also failing on CI due to flock contention
during parallel test execution.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: close store before subprocess to release flock

The root cause of the persistent flock failures was openStore()
deferring Close() to t.Cleanup, keeping the exclusive flock held
while bd subprocess commands tried to acquire it. No amount of
retry can help when the same test holds the lock.

- getCommitHash: open/close store inline instead of via openStore
- show_json_includes_comments: close store after AddIssueComment
- show_as_of: close store after GetCurrentCommit

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 09:15:50 -07:00
matt wilkie
59b49c45f0 fix: add missing //go:build cgo tags to embedded test files and cmd
Several test files and one main.go that depend on CGO-only types
(EmbeddedDoltStore methods like Close, CreateIssue, GetIssue) were
missing //go:build cgo build tags, causing compilation failures when
building with CGO_ENABLED=0.

Files fixed:
- 67 cmd/bd/*_embedded_test.go files
- cmd/bd/metadata_filter_test.go (uses newTestStore from cgo-tagged helper)
- cmd/bd/doctor/federation_test.go (uses doctorTestServerPort/testSharedDB)
- cmd/bd/doctor/fix/migrate_import_test.go (uses fixTestServerPort)
- 6 internal/storage/embeddeddolt/*_test.go files
- internal/storage/embeddeddolt/cmd/main.go

Amp-Thread-ID: https://ampcode.com/threads/T-019d4938-40d4-73ae-89d1-1891a19a9a15
Co-authored-by: Amp <amp@ampcode.com>
2026-04-01 07:08:41 -07:00
coffeegoddd☕️✨
a35edfd28e /{internal,cmd,.goreleaser,.github}: embedded mode by default 2026-03-28 13:47:20 -07:00
coffeegoddd☕️✨
cda9228ae1 /: bump driver to 1.84.0, paralleize embedded tests 2026-03-23 14:55:55 -07:00
coffeegoddd☕️✨
5f022d5729 /{cmd,internal}: implement as of 2026-03-19 12:49:44 -07:00
coffeegoddd☕️✨
15b6190b7a /{cmd,internal}: implement more methods 2026-03-19 12:34:39 -07:00