Skip to content

flake: TestMigrate/Parallel #1383

@flake-investigator

Description

@flake-investigator

CI Run: https://github.com/coder/coder/actions/runs/22720516745
Job: test-go-pg (ubuntu-latest)
Commit: c308db805dc18adcb2b9e737ab0c0949e1e6fd77 (Danielle Maywood)

Failure excerpt:

=== FAIL: coderd/database/migrations TestMigrate/Parallel (22.62s)
    migrate_test.go:65:
        Error:      Received unexpected error:
                    up:
                        github.com/coder/coder/v2/coderd/database/migrations.UpWithFS
                            /home/runner/work/coder/coder/coderd/database/migrations/migrate.go:137
                      - timeout: can't acquire database lock
    broker.go:98: failed to clean up database "test_2026_03_05_13_41_51_crrocnerbj": pq: database "test_2026_03_05_13_41_51_crrocnerbj" is being accessed by other users

Error analysis:

  • Failing test: TestMigrate/Parallel (coderd/database/migrations/migrate_test.go). Two concurrent migrations.Up(db) calls resulted in a lock timeout, then cleanup failed because the DB still had active connections.

Root cause classification:

  • Likely flaky test (migration lock acquisition timing when running parallel migration calls). No panic/OOM/race output observed.

Assignment analysis:

  • Target test lines: t.Run("Parallel", ...) at ~lines 51-65 in coderd/database/migrations/migrate_test.go.
  • git blame -L 51,65 coderd/database/migrations/migrate_test.go (not available via API). Using recent history as proxy:
    • git log --oneline -10 --follow coderd/database/migrations/migrate_test.go shows latest change 92a6d6c2 (Danielle Maywood, loop variable capture cleanup) which appears non-functional.
    • Prior meaningful test change: 79728c3 (Mathias Fredriksson) – migrations data model updates.
    • Component history: git log --oneline -20 coderd/database/migrations shows most recent migrations changes by Danny Kopping (1b08bc76) and Kyle Carberry (34d9392, 0ad2f9e, 12083441).
  • Suggested owner: Danny Kopping (recent migrations component changes; new migrations can increase lock duration and surface this timing issue).

Reproduction (if needed):

  • go test ./coderd/database/migrations -run TestMigrate/Parallel -count=1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions