Skip to content

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

@yanhao98

Description

@yanhao98

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

Suggested fix

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

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

Tested on Bun 1.3.9.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
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