bunfig.toml: [test] timeout is not actually supported by Bun #9267

Closed
opened 2026-02-16 18:12:02 -05:00 by yindo · 1 comment
Owner

Originally created by @yanhao98 on GitHub (Feb 13, 2026).

Originally assigned to: @thdxr on GitHub.

Summary

The timeout field in [test] section of packages/opencode/bunfig.toml does not actually take effect:

[test]
preload = ["./test/preload.ts"]
timeout = 10000  # 10 seconds (default is 5000ms)

Why it doesn't work

Bun's bunfig.toml parser (src/bunfig.zig in oven-sh/bun) does not parse the timeout field from the [test] section. The field is silently ignored, and the default 5000ms timeout is used instead.

This can be verified by:

  1. Setting timeout = 10000 in bunfig.toml
  2. Running a test that sleeps for 6 seconds (longer than the 5s default but shorter than the configured 10s)
  3. The test times out at 5000ms, proving the config is ignored

Context

  • Bun's official docs incorrectly document this as a supported feature, but the implementation doesn't exist
  • Feature request: https://github.com/oven-sh/bun/issues/7789 (open since Dec 2023)
  • The CLI flag --timeout works correctly — only the bunfig.toml config is broken

Suggested fix

Use --timeout in the test script in package.json instead:

{
  "scripts": {
    "test": "bun test --timeout 10000"
  }
}

Tested on Bun 1.3.9.

Originally created by @yanhao98 on GitHub (Feb 13, 2026). Originally assigned to: @thdxr on GitHub. ## Summary The `timeout` field in `[test]` section of `packages/opencode/bunfig.toml` does not actually take effect: ```toml [test] preload = ["./test/preload.ts"] timeout = 10000 # 10 seconds (default is 5000ms) ``` ## Why it doesn't work Bun's bunfig.toml parser (`src/bunfig.zig` in oven-sh/bun) does **not** parse the `timeout` field from the `[test]` section. The field is silently ignored, and the default 5000ms timeout is used instead. This can be verified by: 1. Setting `timeout = 10000` in bunfig.toml 2. Running a test that sleeps for 6 seconds (longer than the 5s default but shorter than the configured 10s) 3. The test times out at 5000ms, proving the config is ignored ## Context - Bun's official docs incorrectly document this as a supported feature, but the implementation doesn't exist - Feature request: https://github.com/oven-sh/bun/issues/7789 (open since Dec 2023) - The CLI flag `--timeout` works correctly — only the bunfig.toml config is broken ## Suggested fix Use `--timeout` in the test script in `package.json` instead: ```json { "scripts": { "test": "bun test --timeout 10000" } } ``` Tested on Bun 1.3.9.
yindo closed this issue 2026-02-16 18:12:02 -05:00
Author
Owner

@yanhao98 commented on GitHub (Feb 13, 2026):

Note

This issue was reported by an AI agent (Claude Code). The analysis is based on reading Bun's source code (src/bunfig.zig) and running a verification test, but I'm not 100% certain the conclusion is correct. Please verify independently.

@yanhao98 commented on GitHub (Feb 13, 2026): > [!NOTE] > This issue was reported by an AI agent (Claude Code). The analysis is based on reading Bun's source code (`src/bunfig.zig`) and running a verification test, but I'm not 100% certain the conclusion is correct. Please verify independently.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9267