Repository navigation
test(lint): linear-time checks alternate their two page sizes so a busy runner slows both - #8837
Merged
Merged
Conversation
…sy runner slows both
miguel-heygen
enabled auto-merge
November 25, 2026 10:05
jrusso1020
approved these changes
Nov 25, 2026
jrusso1020
left a comment
Collaborator
There was a problem hiding this comment.
Review at 6a1b3bb3: APPROVE.
growthnow builds both pages once and times them in turn, small then large, five times. It keeps the fastest of each and returnsbestLarge / bestSmall. Under the old order (small twice, then large twice), a load spike could land only on the large runs. Alternating spreads a spike across both, and the minimum drops the slow ones. The limit stays at 8, so linear work (about 4x) still passes and quadratic work (about 16x) still fails. Both callers (growth(page, 1250)andgrowth(page, 250)) are unchanged.- Cost: 10 lint runs per check instead of 4. At the body's measured 62 ms and 240 ms for 1,250 and 5,000 tags, that is about 1.5 s, well inside the existing
timeout: 120_000. - There is no "fails without the fix:" line. This is a test-only change for a timing flake that can't be reproduced on demand, so the body's load table stands in for one: the old helper's maximum ratio is 7.66 against the new one's 5.83 at the same median. I read that as meeting the intent of the rule, not as a gap.
Need · Size · Reuse · Simpler · Structure: stops a flaky lint check from failing CI on busy runners · +12/−11 · n/a · as simple as it can be · n/a.
Risk: very low. Test only.
— Rames
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
The lint package's linear-time checks (
growthinpackages/lint/src/rules/gsap.test.ts) now time the small and the large page alternately, five times each, and compare the fastest of each. Before, they timed the small page twice, then the large page twice. A busy CI runner no longer fails a check whose code is linear.Why
"lints script tags naming one file in linear time" failed a PR's
Test (support)job today with a ratio of 8.33 against its limit of 8. That job runs the support packages' suites in parallel on one runner. When a load spike falls only on the two large-page runs, the large time inflates while the small one doesn't, and the ratio crosses the limit with no change to the code.The code is linear. On the devbox, linting 1,250 / 2,500 / 5,000 / 10,000 / 20,000 script tags takes 62 / 119 / 240 / 530 / 1,347 ms (fastest of 5). The check's own ratio, 5,000 over 1,250 tags, ranges 4.07 to 4.72 over 15 measurements on a quiet box.
Related work
None.
How
growthbuilds both pages once, then runssmall, largefive times in turn and keeps each one's fastest time. A load spike now lands on both sizes, not just one. The limit (8, halfway between linear 4x and quadratic 16x) and both callers are unchanged.Test plan
The failure depends on timing and doesn't reproduce on demand, so the proof is the spread under load. The old and new
growthwere measured on the same 1,250-tag page, with the run and 3 or 4 bursty busy-loop workers (50-400 ms on, 50-400 ms off) pinned to the same 2 cores:The old helper reaches 7.66 under load, within reach of the 8.33 CI saw. The new one stays under 6. The median is unchanged, so a real move to quadratic work (about 16x) still fails.
gsap.test.ts250/250; the five linear-time checks pass 3 runs in a row.oxlint,oxfmt --check, linttsc --noEmitand the comment-share ratchet are clean.