Repository navigation
Conversation
… ends Six tests read the report of the rule and the note from one `-f stylish` run. Each made a second run with `-f json` before. The case "an option that isn't Prettier's" is now a row of their table. The file starts 30 `bun lint` processes, not 36. 13 of them run a rule in JavaScript, not 19. Two `bun/format` tests start their runs together. Each run has its output, its stderr and its exit code compared. On a debug build a test of this file has 60 s, not 5 s.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 2 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Updated 7:50 AM PT - Oct 27th, 2026
✅ @robobun, your commit 77db2ccb76a83788c1ffa24ee07a7a27e965ccef passed in 🧪 To try this PR locally: bunx bun-pr 47064That installs a local version of the PR into your bun-47064 --bun |
|
Status: ready for review. The change is in CI on the current commit (build 133655):
The review has no open thread. Its one request, the limit of a test on a debug build, is done in 77db2cc. What the numbers are, and how they were measured:
|
…vaScript Replaces the default limit that the file set for debug builds. The tests whose runs have an `eslint.config.mjs` get 120 s on a debug build, the number that the other lint test files give their slow tests. On every other build they keep the limit of the command line or the default. The three tests with an oxlint config keep the default on every build.
There was a problem hiding this comment.
LGTM — test-only tightening of assertions, and the follow-up commit moves the debug-build limit to a per-test { timeout } on the eslint.config.mjs tests, the same shape as the sibling lint test files.
What was reviewed:
- Confirmed
{ timeout: undefined }falls through to the CLI--timeoutand then the default (b.f64.optionalmaps toNoneinsrc/runtime/test_runner/ScopeFunctions.rs:624), so the oxlint tests and non-debug builds keep whatever limit the caller set; CI's ASAN lane is covered by the runner's tripled--timeout, so theisDebug-only guard (siblings also includeisASAN) is fine there. - Checked that
normalizeBunSnapshot(text, dir)strips the[Nms]suffix and trims, so the exact"Linted N files"/ stylish stdout expectations are stable, and thatexpect(value, message)plustoBeOneOfare supported matchers. - Walked each deleted assertion (
not.toContain("ran in JavaScript"),toMatchObjectonbun/formatreports, the standalone "an option that isn't Prettier's" test) to its replacement — every one is now covered by a stricter whole-objecttoEqualor thetest.eachrow with the same name; no check was dropped.
Extended reasoning...
The change touches only test/cli/lint/prettier-rule.test.ts, rewriting its assertions from partial checks to whole-object toEqual on normalized stdout/stderr/exitCode, parallelizing a few sequential runs, and folding one standalone test into the test.each matrix. It touches no security-sensitive surface and no CODEOWNER-covered path. The prior review's one nit (a file-wide setDefaultTimeout under isDebug) was addressed by commit 77db2cc, which replaced it with a per-test timeout on only the tests that evaluate a JavaScript config, matching the pattern in the neighboring lint test files. The bug hunt ran dry, the harness semantics the test relies on were verified from source, and no existing assertion was weakened, so a human look is not needed.
Problem
test/cli/lint/prettier-rule.test.tsstarts 36bun lintprocesses. Six repeat a run in a second format to read one message.bun bd testfails the file: one test needs over 5 s.Fix
runs the package's rule: ...) read the report and the note from one-f stylishrun. Now 30 runs and 18 tests.bun/formattests start their runs together.toContain,not.toContainandtoMatchObject.bun bd test test/cli/lint/prettier-rule.test.ts --timeout 270000, debug build, 24 runs each in turns: median 17.7 s, then 14.6 s. Without the flag: 9 of 9 runs fail, then 6 of 6 pass.Background
bun lint's ownprettier/prettiercannot match Prettier's output, the rule ofeslint-plugin-prettierruns in a JavaScript engine. A note on stderr says why.-f jsonprints no note.-f jsonreport of such a run.doctor.test.ts.toEqualhas the expected text.Notes
The ASAN lane. The time of the file on
debian 13 x64-asan - test-bun, from the log of each build.The second commit changes limits on a debug build only, not what runs. In both builds of this PR the file is the first test file of its shard, because the runner starts the files that a pull request changes first. Main's file is at place 13, after
config-files.test.ts.The log has a time for each batch of tests that end. It does not name the tests. This is what fits the order of the file:
an option that isn't Prettier'sWhat the lane shows:
src/options_types/context.rs:534).The other lanes. No change that the numbers can show. On the release lanes all 18 tests run at once.
The two columns are not like for like: this file is the first test file of its shard in build 133645 (place 3 of its job, after two installs), and main's file is at place 14 or later. #45768 shows what the first place costs on Windows with other files. No Windows machine was available for this work, so the 0.2 to 0.3 s there are not explained.
Which runs are slow on the ASAN lane. The lane sets
detect_leaks=1. A run that executes a rule in JavaScript leaves one 80-byte allocation thattest/leaksan.suppsuppresses by name (Zig__GlobalObject__create), so LeakSanitizer startsllvm-symbolizerwhen the process ends. A run with aneslint.config.mjsand built-in rules only leaves none. One run on a debug build, alone:bunEnvonly.oxlintrc.json,-f unixeslint.config.mjs, built-in ruleeslint.config.mjs, the package's ruleI put a script at
ASAN_SYMBOLIZER_PATHthat counts its calls and then startsllvm-symbolizer. With the variables thatscripts/runner.node.tssets on the lane, main's file starts it 19 times and this file 13 times. Both pass that way (debug build,--max-concurrency=2: the symbolizer needs 1.8 GB for the debug binary, and this machine has 16 GB).What the 30 runs are.
eslint.config.mjs.oxlintrc.jsonThe six runs that are gone are the
-f jsonruns of the five table rows and ofan option that isn't Prettier's. Each compared one thing: the report ofa.jsis the stub's message. The-f stylishrun of the same project prints that message with its position, its severity and the rule's name, and stderr has the note. The format does not change which rule runs: insrc/lint/driver/run.rsit decides only whether the text of a file is kept and whether the notes are printed.an option that isn't Prettier'shad the same body as the table rows, so it is a row now, under the same name.A
-f jsonreport of a file that the package's rule linted stays in: the syntax error test, the Tailwind test (two runs), the disable comment test, and the test with two plugins. In those runs stderr is now compared with the summary line alone, which also shows that-f jsonprints no note.The three tests that need the fix of the built-in rule and the note keep both runs.
Assertions.
expect()calls: 45 before, 43 after. One call now compares what several did, and more:lint()returns the reports, stderr without the time, and the exit code. Each test compares all three withtoEqual. Before a report is parsed,lint()checks that the exit code is 0 or 1, and a failure prints stderr.--fix-dry-run produces Prettier's outputalso checks that no report is left after the fixes, the summary line, and exit code 0.-f stylishruns compare stdout. Two tests hadnot.toContain("ran in JavaScript"). One of them read the stderr of a-f jsonrun, which never has a note. Both compare the whole stderr now.bun/format reports the files it can't checkcompared single keys and usedtoMatchObject. It now compares every file of each run. That adds the config file, which is linted there, and the unused disable comment inoff.jsonce the file can be checked.-f unixruns compare the whole lines aboutbun/format, an empty stderr and the exit code. The lines of oxlint's default rules stay out, as before.Local numbers. Debug build (ASAN) of 92e819d on Linux x64. The machine has 12 logical CPUs, but 12 busy processes take 3.4 times as long as one, so the runs are bound by CPU time and vary.
bun bd test <file> --timeout 270000, 24 runs each in turnsbun bd test <file>, no flagThe 24 runs of this file are from both commits and from the edits before them. None of those changes which processes run.
The limit on a debug build. A run with an
eslint.config.mjstakes 1.4 s or more there, and up to 5 s while four other tests run. With no limit, this file passed 3 of 6 runs ofbun bd testwith no flag. So the 15 tests with such a run get{ timeout }, which is 120 s on a debug build and nothing on any other build: there the command line or the default sets the limit. The three tests with an oxlint config have the default everywhere. 120 s is what the other lint test files give their slow tests (doctor.test.ts:60,js-plugins.test.ts:63,react-compiler.test.ts:68). A limit on a test wins over--timeout, here as there.Not done.
src/, not in this file (test(lint): make rule-throws.test.ts faster and strengthen its assertions #45755 has the stack of the allocation).bun lintprocess: each case keeps its own working directory and its ownnode_modules.[auto-merge] gate passed · iteration 0 · 1 files touched
passes on PR (with fix)
diff hotspot
gate history · 1 passed · 0 rejected · iteration 0
evidence per changed file