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:
- Setting
timeout = 10000 in bunfig.toml
- Running a test that sleeps for 6 seconds (longer than the 5s default but shorter than the configured 10s)
- The test times out at 5000ms, proving the config is ignored
Context
Suggested fix
Use --timeout in the test script in package.json instead:
{
"scripts": {
"test": "bun test --timeout 10000"
}
}
Tested on Bun 1.3.9.
Summary
The
timeoutfield in[test]section ofpackages/opencode/bunfig.tomldoes not actually take effect:Why it doesn't work
Bun's bunfig.toml parser (
src/bunfig.zigin oven-sh/bun) does not parse thetimeoutfield from the[test]section. The field is silently ignored, and the default 5000ms timeout is used instead.This can be verified by:
timeout = 10000in bunfig.tomlContext
--timeoutworks correctly — only the bunfig.toml config is brokenSuggested fix
Use
--timeoutin the test script inpackage.jsoninstead:{ "scripts": { "test": "bun test --timeout 10000" } }Tested on Bun 1.3.9.