Skip to content

test(core): assert migrateAll only on the schemas the test owns - #3

Merged
TheFabFab merged 1 commit into
documentor-pgfrom
migrate-all-race
Oct 9, 2026
Merged

TheFabFab merged 1 commit into
documentor-pgfrom
migrate-all-race

Conversation

@TheFabFab

Copy link
Copy Markdown
Owner

Why

The documentor-pg push run after PR #1 (tool-delta-reads) merged failed in @opencode-ai/core: migration lifecycle > migrateAll brings every schema … up to date got a failed entry for a schema it never created (SELECT id FROM migration on t_bc9c…). The test database is shared by every package's tests and turbo runs them in parallel, so opencode's throwaway schemas are created and dropped while migrateAll scans every schema holding opencode's tables.

What

The test asserts failed only for its own three schemas. migrateAll itself is unchanged.

Verification

Looping this test beside packages/opencode test/session/ on one Postgres: 8 failures in 275 runs with the old assertion, 0 in 247 with the new one. test/pg/migration.test.ts passes (17).

🤖 Generated with Claude Code

The test database is shared by every package's tests, and turbo runs them
in parallel: opencode's tests create and drop throwaway schemas while this
test's migrateAll scans every schema holding opencode's tables. One dropped
mid-scan lands in `failed` ("SELECT id FROM migration"), which failed the
documentor-pg push run after the tool-delta-reads merge. Reproduced locally
by looping this test beside test/session/: 8 failures in 275 runs before,
0 in 247 after.

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

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 72 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@TheFabFab
TheFabFab merged commit fb315b7 into documentor-pg Oct 9, 2026
6 of 11 checks passed
@TheFabFab
TheFabFab deleted the migrate-all-race branch October 9, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant