Skip to content

fix(test): move timeout config to CLI flag#13494

Merged
R44VC0RP merged 1 commit intoanomalyco:devfrom
yanhao98:fix/bunfig-timeout
Feb 13, 2026
Merged

fix(test): move timeout config to CLI flag#13494
R44VC0RP merged 1 commit intoanomalyco:devfrom
yanhao98:fix/bunfig-timeout

Conversation

@yanhao98
Copy link
Contributor

Summary

  • [test] timeout in bunfig.toml is not actually parsed by Bun's config loader (src/bunfig.zig in oven-sh/bun). 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.

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

`[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
Copilot AI review requested due to automatic review settings February 13, 2026 15:11
@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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’s test script to run bun test --timeout 30000.
  • Remove the non-functional [test].timeout from packages/opencode/bunfig.toml and 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",
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +7
# 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
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
# 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

Copilot uses AI. Check for mistakes.
@R44VC0RP R44VC0RP merged commit bc1fd06 into anomalyco:dev Feb 13, 2026
14 of 15 checks passed
github-actions bot pushed a commit to chrn11/opencode that referenced this pull request Feb 13, 2026
Co-authored-by: 严浩 <h_mini2024@oo1.dev>
github-actions bot pushed a commit to chrn11/opencode that referenced this pull request Feb 13, 2026
Co-authored-by: 严浩 <h_mini2024@oo1.dev>
github-actions bot pushed a commit to chrn11/opencode that referenced this pull request Feb 13, 2026
Co-authored-by: 严浩 <h_mini2024@oo1.dev>
github-actions bot pushed a commit to chrn11/opencode that referenced this pull request Feb 13, 2026
Co-authored-by: 严浩 <h_mini2024@oo1.dev>
TechnicallyAnna pushed a commit to TechnicallyAnna/opencode that referenced this pull request Feb 13, 2026
Co-authored-by: 严浩 <h_mini2024@oo1.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants