-
Notifications
You must be signed in to change notification settings - Fork 886
chore(test): queue only full-suite runs behind the exclusive-run lock #2428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
olddonkey
wants to merge
2
commits into
lidge-jun:dev
from
olddonkey:chore/test-lock-full-suite-only
+69
−4
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 Performance & Scalability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: lidge-jun/opencodex
Length of output: 6898
🌐 Web query:
For Bun 1.4.0, confirm thatbun test --timeout 30000runs test discovery without a positional test filter, and list test CLI options that consume a separate path or numeric value.💡 Result:
Yes, running
bun test --timeout 30000performs test discovery for all test files in the project directory when no positional test filter is provided [1][2][3]. The--timeoutflag globally sets the per-test timeout in milliseconds (in this case, 30 seconds), while the test runner continues its default behavior of recursively scanning the working directory for files matching patterns such as*.test.jsor*.spec.ts[1][2][3][4]. Test CLI options that accept a numeric value (often used for timeouts or concurrency limits) include: --timeout : Sets the per-test timeout in milliseconds [1][2][5]. --parallel : Althoughbun test --parallelis often used as a flag, if specified with a numeric value (e.g., --parallel 4), it controls the number of test files to run in parallel [6]. Note that while--timeoutis a direct CLI option forbun test, most other numeric constraints in Bun's test environment are typically configured via the test file itself (e.g., the third argument to thetest()function) rather than through separate CLI path numeric values [2][7].Citations:
🏁 Script executed:
Repository: lidge-jun/opencodex
Length of output: 29407
🌐 Web query:
Bun 1.4.0 bun test CLI documentation: determine whether --preload consumes a separate path argument, which test options consume separate values, and whether bun test --timeout 30000 has no positional test filter.💡 Result:
In Bun 1.4.0, the bun test CLI behavior regarding the specified options is as follows: --preload argument behavior The --preload option does consume a separate path argument [1][2]. It is used to load scripts (such as global setup or mocks) before the test files are executed [2]. Multiple --preload flags can be provided to load multiple files [1]. Test options consuming separate values Several CLI options for bun test require a separate value argument: --timeout: Specifies the per-test timeout in milliseconds (e.g., --timeout 30000) [3][2]. --retry: Specifies the number of times to retry failed tests [3]. --test-name-pattern (or -t): Accepts a regex pattern to filter tests by name [3][4]. --parallel: While it functions as a flag, it can optionally take a numeric value to specify the number of worker processes (e.g., --parallel=4) [5]. --reporter: Accepts a reporter type (e.g., --reporter=junit) [1]. --reporter-outfile: Accepts a file path for the reporter output [1]. --tsconfig-override: Accepts a path to a custom tsconfig file [2]. --conditions: Accepts a comma-separated list of conditions for module resolution [2]. bun test --timeout 30000 and positional filters The command bun test --timeout 30000 does not inherently include a positional test filter unless a specific path or substring match is appended [3][4]. In the Bun test runner, positional arguments are treated as substring filters for test file paths [4]. If you run bun test --timeout 30000, Bun will run all discovered test files with a 30,000ms timeout [3][2]. If you wanted to filter for a specific test file or directory, you would append it as a positional argument, for example: bun test --timeout 30000./path/to/test.test.ts [3][4]. [3][4][2]
Citations:
Consume separate Bun option values before classifying filters.
At
scripts/test.ts:68,isFullSuiteRun(["--timeout", "30000"])treats30000as a positional filter. The wrapper then omits"./tests/"and skipswaitForExclusiveRunat line 174, allowing concurrent full-suite runs to contend for CPU. The same applies to--preload ./setup.tsand other value-taking options.Track values for supported options, keep them in the child argv, and exclude them from filter detection. Add regressions for numeric and path-valued options. Each case must append
"./tests/".🤖 Prompt for AI Agents