beads/internal/storage
Julian Knutsen aaeaedc386
fix(test): retry contended migration lock when re-running schema init on the shared test DB (#7235)
TestSchemaMigrationDoesNotCommitPreExistingStagedData flaked in the
server-Dolt storage tier (shard 4/16) with:

  initSchemaOnDB: schema migration: schema: acquire migration lock:
  schema migration lock unavailable: timeout

Every setupTestStore caller shares testSharedDB, and MigrateUpWithLock's
GET_LOCK name is database-scoped, so a test that re-runs schema init
contends with every parallel test's setup-time init for the same lock.
setupTestStore already uses initSchemaOnDBWithRetry for exactly this
reason, but schema_migration_dirty_test.go (4 sites) and
schema_version_test.go (2 sites) called the bare initSchemaOnDB, which
gives up after a single 5s wait. On a loaded runner a neighbour holds the
lock longer than that and the test fails. Production code retries this
case (isRetryableError covers schema.IsMigrationLockError), so this is
test-side only.

Route those calls through a rerunSchemaInitOnTestStore helper that uses
initSchemaOnDBWithRetry. It retries only a contended lock or a transient
connection error, never a migration result, so the asserted outcomes
(including the expected "pre-existing dirty tables changed" error) are
unchanged.

Seen on four unrelated PR branches in three days. Bazel repro (shard-4
test set, server pinned to 6 CPUs, --local_test_jobs=6): before 1/16
runs failed with the CI signature; after 32/32 passed.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 02:21:42 -07:00
..
backendnames test(bazel): runfiles helpers + declared inputs for scan-guard tests (#6828) 2026-09-27 08:24:08 -07:00
backends feat(backends): registry Remote + OpenWith options; beads.OpenBestAvailableWith for embedders (#7188) 2026-10-04 09:34:36 -07:00
batchbench perf(issueops): indexed dep-add cycle/hierarchy walks; pin blocked-state lookup plans; split waits-for spawner checks (#7224) 2026-10-04 23:43:32 -07:00
batchfixtures perf(issueops): indexed dep-add cycle/hierarchy walks; pin blocked-state lookup plans; split waits-for spawner checks (#7224) 2026-10-04 23:43:32 -07:00
contextinfo test(bazel): runfiles helpers + declared inputs for scan-guard tests (#6828) 2026-09-27 08:24:08 -07:00
createbatchequiv perf(issueops): indexed dep-add cycle/hierarchy walks; pin blocked-state lookup plans; split waits-for spawner checks (#7224) 2026-10-04 23:43:32 -07:00
dberrors test(bazel): runfiles helpers + declared inputs for scan-guard tests (#6828) 2026-09-27 08:24:08 -07:00
dbproxy fix(doltserver): auto-started dolt must own its port; move a taken bd-chosen port (#7201) 2026-10-04 09:22:03 -07:00
depid test(bazel): runfiles helpers + declared inputs for scan-guard tests (#6828) 2026-09-27 08:24:08 -07:00
dolt fix(test): retry contended migration lock when re-running schema init on the shared test DB (#7235) 2026-10-05 02:21:42 -07:00
doltutil perf(dolt): pin MaxAllowedPacket in the server DSN to drop a per-connection round trip (#5273 item 4) (#5316) 2026-10-01 01:10:37 -07:00
domain feat(cli): add --if-revision compare-and-swap guard to update/close/assign/delete (#7203) 2026-10-04 13:38:01 -07:00
embeddeddolt test(cli): close mc-zndi7.76's --if-revision single-winner test gaps (#7233) 2026-10-05 01:57:10 -07:00
externaldeps fix(externaldeps): guard explicit claims and batch closes (#6738) 2026-10-01 01:35:54 -07:00
fs test(bazel): runfiles helpers + declared inputs for scan-guard tests (#6828) 2026-09-27 08:24:08 -07:00
git test(bazel): runfiles helpers + declared inputs for scan-guard tests (#6828) 2026-09-27 08:24:08 -07:00
issueops perf(issueops): indexed dep-add cycle/hierarchy walks; pin blocked-state lookup plans; split waits-for spawner checks (#7224) 2026-10-04 23:43:32 -07:00
journalscan test(bazel): runfiles helpers + declared inputs for scan-guard tests (#6828) 2026-09-27 08:24:08 -07:00
kvkeys test(bazel): runfiles helpers + declared inputs for scan-guard tests (#6828) 2026-09-27 08:24:08 -07:00
memoryops test(bazel): runfiles helpers + declared inputs for scan-guard tests (#6828) 2026-09-27 08:24:08 -07:00
rowid test(bazel): runfiles helpers + declared inputs for scan-guard tests (#6828) 2026-09-27 08:24:08 -07:00
schema docs(agents): contributor-only agent instructions and documented-issue intake (#7223) 2026-10-05 08:43:53 +00:00
sqlbuild perf(storage): SearchIssueSummaries narrow-projection foundation (be-nu4.3) (#3458) 2026-10-01 01:19:24 -07:00
sqlclass fix(sql): classify bd sql statements with the SQL parser; never drop result sets (#6932) 2026-09-29 01:08:10 -07:00
sqlcount feat(httpapi): opt-in large issues:batchApply envelope (≤1000 items, one transaction) (#7051) 2026-10-01 08:32:56 -07:00
storagecontract test(bazel): runfiles helpers + declared inputs for scan-guard tests (#6828) 2026-09-27 08:24:08 -07:00
uow test(cli): close mc-zndi7.76's --if-revision single-winner test gaps (#7233) 2026-10-05 01:57:10 -07:00
versioncontrolops feat(backup): proxied auto-backup on managed-local, serialized with bd backup sync (#6879) 2026-09-28 02:45:58 -07:00
advanced_queries.go /internal/storage: add interfaces for methods not covered by Storage 2026-03-06 15:30:10 -08:00
annotation_queries.go Update internal/storage/annotation_queries.go 2026-03-06 15:40:56 -08:00
batch.go refactor: delete the dead orphan-handling capability (bd-gwryr) (#5497) 2026-08-09 12:03:18 -07:00
batch_apply.go Add issueops.BatchApplier: one plan, one transaction (#5480) 2026-08-09 06:59:34 -07:00
batch_apply_test.go feat(httpapi): opt-in large issues:batchApply envelope (≤1000 items, one transaction) (#7051) 2026-10-01 08:32:56 -07:00
batch_close_policy.go fix(externaldeps): guard explicit claims and batch closes (#6738) 2026-10-01 01:35:54 -07:00
batch_close_policy_test.go fix(externaldeps): guard explicit claims and batch closes (#6738) 2026-10-01 01:35:54 -07:00
BUILD.bazel perf(issueops): batch create/import without per-row round trips; on-demand graph checks (#7205) 2026-10-04 13:56:12 -07:00
bulk_issues.go feat(reclaim): scope filters --label/--label-any/--exclude-label/--assignee/--id (wy-jpd3.3) 2026-07-24 05:31:23 -07:00
child_counter_reservation.go fix(create): commit labels during initial issue creation (#4149) 2026-05-24 19:23:46 -07:00
compaction.go fix(compact): archive content before destructive compaction; make restore work (#4464) 2026-06-20 14:12:07 -07:00
config_metadata.go feat: custom status categories (active/wip/done/frozen) 2026-03-21 12:35:03 -07:00
contract_leg_registry_test.go test(storage): register the contract legs instead of discovering them (#5499) 2026-08-09 13:08:26 -07:00
dependency_queries.go feat(storage): events + dependents reads, batched blocked, public claim surface (#4926) 2026-07-22 07:41:47 -07:00
diff_store.go perf(export): incremental auto-export via dolt_diff (#5806) 2026-08-22 06:49:19 -07:00
directory_size.go fix(backup): report embedded database size (#4920) (#4928) 2026-07-25 16:14:07 -07:00
directory_size_test.go fix(backup): report embedded database size (#4920) (#4928) 2026-07-25 16:14:07 -07:00
errors_unsupported.go feat(issueops): put every issue capability behind one library surface 2026-08-04 12:27:56 -07:00
event_queries.go feat(storage): events + dependents reads, batched blocked, public claim surface (#4926) 2026-07-22 07:41:47 -07:00
federation.go /internal/storage: add interfaces for methods not covered by Storage 2026-03-06 15:30:10 -08:00
history_presence.go fix(export): heal the delete wedge — prove deletions via store history instead of refusing forever (#5896) (#6059) 2026-08-29 21:24:29 -07:00
history_viewer.go feat(storage): add ExternalRefHistoryQuerier capability for external-ref history (#4733) 2026-07-12 13:43:27 -07:00
hook_batch_applier.go fix: a re-close that runs on_close, a silent cycle-gate walker, and a leaf that contradicts the wire (#5537) 2026-08-10 02:37:34 -07:00
hook_batch_applier_test.go fix: a re-close that runs on_close, a silent cycle-gate walker, and a leaf that contradicts the wire (#5537) 2026-08-10 02:37:34 -07:00
hook_batch_closer.go fix(externaldeps): guard explicit claims and batch closes (#6738) 2026-10-01 01:35:54 -07:00
hook_batch_closer_test.go fix(externaldeps): guard explicit claims and batch closes (#6738) 2026-10-01 01:35:54 -07:00
hook_batch_creator.go Trim this series' comments toward the repo's own density 2026-08-06 08:06:59 +00:00
hook_blockingannotator.go feat(list): put bd list behind Reader.List and the new BlockingAnnotator role (bd-5k21g) 2026-08-06 02:56:57 +00:00
hook_bootstrapper.go Trim this series' comments toward the repo's own density 2026-08-06 08:06:59 +00:00
hook_commenter.go feat(issueops): put every issue capability behind one library surface 2026-08-04 12:27:56 -07:00
hook_commenter_test.go feat(issueops): put every issue capability behind one library surface 2026-08-04 12:27:56 -07:00
hook_counter.go feat(issueops): put bd count behind the Counter role (bd-m8hn7) 2026-08-05 05:27:39 +00:00
hook_cycle_detector.go feat(issueops): put bd dep cycles behind the CycleDetector role (bd-wfkbv) 2026-08-05 09:36:14 +00:00
hook_decorator.go cmd/bd: bd label rename <old> <new> (stacked on #6007) (#6009) 2026-09-29 17:02:35 -07:00
hook_decorator_internal_test.go fix(export): promoted no-history wisps survive import round-trip (bd-r9uce) (#5368) 2026-08-05 12:48:44 -07:00
hook_decorator_test.go fix(telemetry): wire WrapStorage decorator into bd storage chain (#3858) 2026-07-06 22:27:32 -07:00
hook_deleter.go Trim this series' comments toward the repo's own density 2026-08-06 08:06:59 +00:00
hook_dependency_editor.go feat(issueops): put every issue capability behind one library surface 2026-08-04 12:27:56 -07:00
hook_dependency_editor_test.go feat(issueops): put every issue capability behind one library surface 2026-08-04 12:27:56 -07:00
hook_edgereader.go feat(issueops): put multi-id bd dep list behind the EdgeReader role (bd-nhsno) 2026-08-05 09:42:06 +00:00
hook_graph_counter.go Add issueops.GraphCounter: how many edges, in one named direction (ga-itny5) (#5485) 2026-08-09 11:29:32 -07:00
hook_init_verifier.go feat(init): put bd init's identity seam behind Bootstrapper and InitVerifier (bd-zl3u8) 2026-08-06 03:01:33 +00:00
hook_issue_claimer.go Add issueops.Claimer and route the HTTP claim through it (#5334) 2026-08-04 08:40:18 -07:00
hook_issue_claimer_test.go Add issueops.Claimer and route the HTTP claim through it (#5334) 2026-08-04 08:40:18 -07:00
hook_issue_operations.go fix: a re-close that runs on_close, a silent cycle-gate walker, and a leaf that contradicts the wire (#5537) 2026-08-10 02:37:34 -07:00
hook_issue_operations_test.go Add issueops.Releaser: give a claim back, optionally only a named holder's (#5482) 2026-08-09 07:48:56 -07:00
hook_issue_reader.go feat(issueops): add the Reader role and wire both front doors through it 2026-07-31 18:37:25 +00:00
hook_issue_reader_test.go test(telemetry,storage): pin the Reader decorators the way Lifecycle is pinned 2026-07-31 18:37:26 +00:00
hook_memories.go Put the memory plane behind memoryops, conformance-tested at three backends (#5387) 2026-08-07 03:57:04 -07:00
hook_metadata_cas.go Add issueops.MetadataCAS: compare-and-set over one metadata key (#5473) 2026-08-09 04:15:34 -07:00
hook_metadata_cas_test.go Add issueops.MetadataCAS: compare-and-set over one metadata key (#5473) 2026-08-09 04:15:34 -07:00
hook_querier.go feat(query): put bd query behind the Querier role and stop it dropping matches (bd-pohmh) 2026-08-05 16:36:05 +00:00
hook_ready_claimer.go feat(issueops): put every issue capability behind one library surface 2026-08-04 12:27:56 -07:00
hook_ready_claimer_test.go feat(issueops): put every issue capability behind one library surface 2026-08-04 12:27:56 -07:00
hook_ready_counter.go feat(ready): put bd ready's published total behind the ReadyCounter role (bd-s10oa) 2026-08-05 09:47:24 +00:00
hook_relations.go feat(issueops): put every issue capability behind one library surface 2026-08-04 12:27:56 -07:00
hook_relations_test.go feat(issueops): put every issue capability behind one library surface 2026-08-04 12:27:56 -07:00
hook_releaser.go Add issueops.Releaser: give a claim back, optionally only a named holder's (#5482) 2026-08-09 07:48:56 -07:00
hook_releaser_test.go Add issueops.Releaser: give a claim back, optionally only a named holder's (#5482) 2026-08-09 07:48:56 -07:00
hook_role_census_test.go Publish POST /v0/beads/issues/{id}/comments, the wire half of issueops.Commenter (ga-rslox) (#5594) 2026-08-10 18:59:57 -07:00
hook_stats_reporter.go feat(issueops): put bd status behind the StatsReporter role (bd-4ze25) 2026-08-05 09:27:16 +00:00
hook_sweeper.go Trim this series' comments toward the repo's own density 2026-08-06 08:06:59 +00:00
hook_tree_walker.go feat(issueops): put bd dep tree behind the TreeWalker role (bd-lx5iu) 2026-08-06 03:09:18 +00:00
hook_version_reconciler.go Trim this series' comments toward the repo's own density 2026-08-06 08:06:59 +00:00
hook_workspace_config.go Trim this series' comments toward the repo's own density 2026-08-06 08:06:59 +00:00
issue_create_dependencies.go feat(storage): one guarded issue-lifecycle surface for the CLI and linked consumers (#5191) 2026-07-31 11:26:38 -07:00
iter.go Reapply "Simplify the supported backends: roll back the direct PostgreSQL and MySQL adapters" (#4857) 2026-07-18 02:43:56 +00:00
journal_facade_test.go feat(journalops): the mutation journal becomes the third facade namespace (#5552) 2026-08-10 10:58:05 -07:00
leg_contract_wiring_test.go test(bazel): runfiles helpers + declared inputs for scan-guard tests (#6828) 2026-09-27 08:24:08 -07:00
merge_slot.go feat: add MergeSlot methods to Storage interface (fix-merge PR #2787) 2026-03-26 19:34:21 -07:00
metadata.go fix(contracts): JSON contract fixes before 1.3.0 freezes them — string revision tokens, --set-metadata scalar typing, create --json nano timestamps (#6053) 2026-08-29 05:20:27 +00:00
metadata_cas.go Add issueops.MetadataCAS: compare-and-set over one metadata key (#5473) 2026-08-09 04:15:34 -07:00
metadata_cas_test.go Add issueops.MetadataCAS: compare-and-set over one metadata key (#5473) 2026-08-09 04:15:34 -07:00
metadata_edit_value_test.go fix(contracts): JSON contract fixes before 1.3.0 freezes them — string revision tokens, --set-metadata scalar typing, create --json nano timestamps (#6053) 2026-08-29 05:20:27 +00:00
metadata_jsonpath_test.go fix(query): make slash and mixed-case metadata keys queryable (#4896) 2026-07-24 17:52:22 -07:00
metadata_schema_test.go feat: config-driven metadata schema enforcement (GH#1416 Phase 2) (#2027) 2026-02-24 22:24:56 -08:00
metadata_test.go feat: allow UpdateIssue metadata updates via json.RawMessage/[]byte (#1417) 2026-02-03 17:55:23 -08:00
remote.go feat(storage): carry the git data ref of a git-backed Dolt remote (#6521) 2026-09-27 15:56:18 -07:00
remote_ref.go feat(storage): carry the git data ref of a git-backed Dolt remote (#6521) 2026-09-27 15:56:18 -07:00
remote_ref_test.go feat(storage): carry the git data ref of a git-backed Dolt remote (#6521) 2026-09-27 15:56:18 -07:00
role_accessor_decorator_test.go docs: the ext-api-store documentation tranche — post-#5516 auth sweep, wave doc coherence, role checklist refresh (#5545) 2026-08-10 08:05:07 -07:00
storage.go feat(cli): add --if-revision compare-and-swap guard to update/close/assign/delete (#7203) 2026-10-04 13:38:01 -07:00
sync.go /internal/storage: add interfaces for methods not covered by Storage 2026-03-06 15:30:10 -08:00
version_control.go fix(compact): replay cherry-picks in commit_order, not commit date (#6644) 2026-09-27 02:06:57 -07:00
versioned.go feat(storage): carry the git data ref of a git-backed Dolt remote (#6521) 2026-09-27 15:56:18 -07:00
wake_defers.go fix(deps): enforce external capability blockers across ready/claim/close (#4769) (#4753) 2026-09-02 16:56:23 -07:00