fix(test): move timeout config to CLI flag#13494
Conversation
`[test] timeout` in bunfig.toml is not actually parsed by Bun's config loader (src/bunfig.zig). The setting was silently ignored, falling back to the default 5000ms instead of the intended 30000ms. Move the timeout to `--timeout` CLI flag in the test script, which works correctly. Ref: oven-sh/bun#7789
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
There was a problem hiding this comment.
Pull request overview
This PR addresses Bun’s unsupported bunfig.toml [test].timeout setting by moving the test timeout configuration to a supported bun test --timeout CLI flag for the packages/opencode test script.
Changes:
- Update
packages/opencode’stestscript to runbun test --timeout 30000. - Remove the non-functional
[test].timeoutfrompackages/opencode/bunfig.tomland add comments referencing the Bun upstream issue.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/opencode/package.json | Adds --timeout 30000 to the package’s bun test script to ensure intended timeout is applied. |
| packages/opencode/bunfig.toml | Removes the ignored timeout config and documents the Bun limitation with a link. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "scripts": { | ||
| "typecheck": "tsgo --noEmit", | ||
| "test": "bun test", | ||
| "test": "bun test --timeout 30000", |
There was a problem hiding this comment.
Only the test script passes --timeout 30000. This package also runs tests via bun test --coverage in the lint script, which will still use Bun’s default 5000ms timeout and can fail for tests that install dependencies (e.g. Config.waitForDependencies() in test/config/config.test.ts). Consider adding the same --timeout 30000 flag there (or factoring a shared base test command) to keep test execution consistent.
| # timeout is not actually parsed from bunfig.toml (see src/bunfig.zig in oven-sh/bun) | ||
| # using --timeout in package.json scripts instead | ||
| # https://github.com/oven-sh/bun/issues/7789 |
There was a problem hiding this comment.
The comment says “timeout is not actually parsed from bunfig.toml”, but it’s specifically the [test].timeout field that Bun currently ignores (while [test].preload is still used). Consider rewording to avoid implying Bun ignores the whole bunfig file, and (optionally) mention the Bun version(s) affected for future readers.
| # timeout is not actually parsed from bunfig.toml (see src/bunfig.zig in oven-sh/bun) | |
| # using --timeout in package.json scripts instead | |
| # https://github.com/oven-sh/bun/issues/7789 | |
| # Note: [test].timeout is not currently parsed from bunfig.toml (see src/bunfig.zig in oven-sh/bun), | |
| # so we use --timeout in package.json scripts instead. [test].preload is still honored. | |
| # See: https://github.com/oven-sh/bun/issues/7789 |
Co-authored-by: 严浩 <h_mini2024@oo1.dev>
Co-authored-by: 严浩 <h_mini2024@oo1.dev>
Co-authored-by: 严浩 <h_mini2024@oo1.dev>
Co-authored-by: 严浩 <h_mini2024@oo1.dev>
Co-authored-by: 严浩 <h_mini2024@oo1.dev>
Summary
[test] timeoutinbunfig.tomlis not actually parsed by Bun's config loader (src/bunfig.zigin oven-sh/bun). The setting was silently ignored, falling back to the default 5000ms instead of the intended 30000ms.--timeoutCLI flag in the test script, which works correctly.Context
Note
This PR was created by an AI agent (Claude Code). The analysis is based on reading Bun's source code and running a verification test. Please verify independently.
🤖 Generated with Claude Code