Skip to content

fix(api): give the migration tests a timeout that matches their work - #582

Merged
github-actions[bot] merged 1 commit into
developfrom
fix/migration-test-timeout
Aug 22, 2026
Merged

fix(api): give the migration tests a timeout that matches their work#582
github-actions[bot] merged 1 commit into
developfrom
fix/migration-test-timeout

Conversation

@tomymaritano

Copy link
Copy Markdown
Collaborator

Problem

tests/runMigrations.test.ts > records migrations that already exist in the schema times out intermittently and blocks unrelated PRs. It blocked #581 until I reran the job, which then passed — a flake, not a break.

Why it is slow

Not a bug. Each test creates a real libsql file database in /tmp and drives the entire MIGRATIONS catalog through it. The failing one calls applyMigrations twice. CI measured:

Test Duration
applies the catalog to an empty database, then no-ops 3004 ms
records migrations that already exist in the schema 7376 ms

vitest's default is 5000 ms and there is no testTimeout configured anywhere in the repo. The suite has been living one runner hiccup away from red.

Fix

An explicit 30s budget on those two tests, with a comment saying why.

Scoped deliberately: a global testTimeout bump would hide genuinely slow unit tests elsewhere. These two are the only ones doing real database I/O, so they are the only ones that should carry a longer budget.

Verified locally: pnpm --filter @dripnex/api test → 59/59 pass.

🤖 Generated with Claude Code

They drive a real libsql file database through the whole migration catalog —
the second one twice — which is legitimately slower than vitest's 5s default.
CI measured 3.0s and 7.4s, so the slower one times out intermittently and
blocked #581 until a rerun.

Scoped to the two tests rather than a global testTimeout bump, which would
mask genuinely slow unit tests elsewhere.

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

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@tomymaritano, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 12 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e50333ed-ffcc-471e-9525-4942ab5f11eb

📥 Commits

Reviewing files that changed from the base of the PR and between 2f2bb4a and 2007c13.

📒 Files selected for processing (1)
  • packages/api/tests/runMigrations.test.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions
github-actions Bot enabled auto-merge (squash) August 22, 2026 22:34
@github-actions
github-actions Bot merged commit b378a93 into develop Aug 22, 2026
16 checks passed
tomymaritano added a commit that referenced this pull request Aug 23, 2026
…585)

## Context

I enabled **Allow GitHub Actions to create and approve pull requests**
at the org and repo level, which unblocked `sync-develop` — it had been
failing with `GitHub Actions is not permitted to create or approve pull
requests` since forever. Re-running it against the v0.17.0 build now
succeeds.

But it immediately produced #584, which **cannot merge**.

## The problem

`sync-develop` opened a `develop ← main` PR. That shape deadlocks:
`develop` requires the head branch to be up to date, and `main` falls
behind `develop` the moment anything lands after the release — #582 and
#583 did exactly that. #584 has been sitting at `BEHIND` since it was
created. I hit the same wall by hand earlier tonight with #577.

Even if it could merge, the squash auto-merge would replay the content
as a fresh commit and **not** establish ancestry, which is the entire
point of a back-merge. That is what went wrong in #578 and #579.

## The fix

Push a branch descended from `develop` with `main` merged into it, then
open that against `develop`. Same thing that finally worked manually in
#581.

- Named `chore/backmerge-main-<tag>`, which matches the exclusion added
in #580 so `automerge.yml` leaves it alone.
- The job arms auto-merge itself with `--merge`, so it lands as a merge
commit.
- Exits early when `main` is already an ancestor, or when the branch
already exists, so re-runs are safe.

## Follow-up

#584 should be closed — this replaces it. The next release will exercise
this path for real.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.18.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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