Skip to content

fix: model-based tests intermittently timeout (5s limit) #366

@BYK

Description

@BYK

Problem

Several model-based tests using fast-check intermittently timeout with the default 5000ms limit:

  • test/lib/db/model-based.test.ts — "alias lookup is case-insensitive"
  • test/lib/db/pagination.model-based.test.ts — "get on empty table returns undefined", "composite key: different command keys are independent"
  • test/lib/db/dsn-cache.model-based.test.ts — "random sequences of cache operations maintain consistency"

These fail even when run in isolation:

bun test test/lib/db/model-based.test.ts test/lib/db/pagination.model-based.test.ts test/lib/db/dsn-cache.model-based.test.ts
# 13 pass, 5 fail — all timeouts

Possible fixes

  1. Increase the per-test timeout for model-based tests (e.g., test.timeout(15_000))
  2. Reduce DEFAULT_NUM_RUNS or number of commands generated per run
  3. Profile to find which command sequences are slow (likely DB-heavy sequences with many upserts)

Impact

Low — these are property-based tests that occasionally hit slow command sequences. CI usually passes because the timeouts are intermittent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions