Skip to content

test: use --timeout CLI flag for model-based test timeouts#367

Merged
BYK merged 1 commit intomainfrom
fix/366-test-timeouts
Mar 6, 2026
Merged

test: use --timeout CLI flag for model-based test timeouts#367
BYK merged 1 commit intomainfrom
fix/366-test-timeouts

Conversation

@BYK
Copy link
Member

@BYK BYK commented Mar 6, 2026

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"

Root Cause

bunfig.toml's timeout = 30000 under [test] is not a supported config key in Bun 1.3.x — it's silently ignored. All tests were running with Bun's default 5000ms per-test timeout.

Model-based tests routinely take 5–17s per test due to 50 fast-check iterations, each creating a new SQLite DB (12 tables + migrations) with size: "+1" generating 10–30+ command sequences.

Changes

  1. bunfig.toml — Remove non-functional timeout = 30000
  2. package.json — Add --timeout 15000 to test:unit, test:isolated, and test:e2e scripts
  3. AGENTS.md — Document the bunfig.toml timeout gotcha as a lore entry

Fixes #366

bunfig.toml's timeout key is not supported by Bun 1.3.x — it silently
has no effect, leaving all tests at the default 5000ms per-test timeout.
Model-based tests (50 iterations × full SQLite schema init × 10-30
command sequences) routinely need 5-13s per test, causing intermittent
failures.

Changes:
- Remove non-functional timeout=30000 from bunfig.toml
- Add --timeout 15000 to test:unit, test:isolated, test:e2e scripts
- Document the bunfig.toml timeout gotcha in AGENTS.md
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (project) Display platform suggestions in multi-column tables by betegon in #365

Bug Fixes 🐛

  • (log-view) Support multiple log IDs and validate hex format by BYK in #362
  • (logs) Harden log schemas against API response format variations by BYK in #361
  • Improve argument parsing for common user mistakes by BYK in #363

Internal Changes 🔧

  • (delta-upgrade) Lazy chain walk, GHCR retry, parallel I/O, offline cache by BYK in #360
  • Use --timeout CLI flag for model-based test timeouts by BYK in #367

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

Codecov Results 📊

104 passed | Total: 104 | Pass Rate: 100% | Execution Time: 0ms

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 3870 uncovered lines.
✅ Project coverage is 81.23%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    81.02%    81.23%    +0.21%
==========================================
  Files          129       130        +1
  Lines        20363     20621      +258
  Branches         0         0         —
==========================================
+ Hits         16499     16751      +252
- Misses        3864      3870        +6
- Partials         0         0         —

Generated by Codecov Action

@BYK BYK changed the title fix(test): use --timeout CLI flag for model-based test timeouts test: use --timeout CLI flag for model-based test timeouts Mar 6, 2026
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@BYK BYK merged commit 3e67589 into main Mar 6, 2026
21 checks passed
@BYK BYK deleted the fix/366-test-timeouts branch March 6, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant