Skip to content

[v0.21.x-branch] Backport #11206: invoices: bound rapid migration test workload - #11215

Merged
ziggie1984 merged 1 commit into
v0.21.x-branchfrom
backport-11206-to-v0.21.x-branch
Sep 21, 2026
Merged

ziggie1984 merged 1 commit into
v0.21.x-branchfrom
backport-11206-to-v0.21.x-branch

Conversation

@github-actions

Copy link
Copy Markdown

Backport of #11206


Change

TestMigrateSingleInvoiceRapid performed Rapid's default 100 property checks,
but generated and migrated another 100 invoices inside every check for both
SQLite and Postgres. The resulting 20,000 migrations and delayed database
cleanup made the race build exceed the Postgres fixture's fixed ten-minute
lifetime.

  • Run SQLite and Postgres as separate subtests so the Postgres fixture lifetime
    covers only Postgres checks.
  • Close each database when its Rapid property check finishes instead of
    retaining every handle until the outer test exits.
  • Migrate a bounded batch of ten randomized invoices per property check. This
    retains multiple migrations in one transaction and post-commit lookup
    coverage while replacing the accidental 100-by-100 multiplier with 1,000
    generated invoices per backend.

This addresses the repeated race-job timeout observed after the Go 1.27.1
toolchain update in #11200 without increasing the fixture timeout.

Verification

  • Full Go 1.27.1 race run of TestMigrateSingleInvoiceRapid: pass in 142.330s.
  • Fixed-seed 20-check comparison: 30.884s, down from 65.900s.
  • make lint-native: 0 issues.

Run the SQLite and Postgres property checks as isolated subtests, close each database after its check, and migrate a bounded batch of randomized invoices per Rapid iteration. This preserves multi-invoice transaction coverage while preventing the accidental 100-by-100 workload from exhausting the Postgres fixture under the race detector.

(cherry picked from commit 381faa6)
@ziggie1984
ziggie1984 merged commit 2ba276a into v0.21.x-branch Sep 21, 2026
@ziggie1984
ziggie1984 deleted the backport-11206-to-v0.21.x-branch branch September 21, 2026 19: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