Skip to content

test(markdown): size the streamed-reveal documents to fit a loaded runner - #35400

Merged
nwparker merged 1 commit into
mainfrom
nwparker/comment-markdown-parse-reuse-size
Oct 28, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/comment-markdown-parse-reuse-size

Conversation

@nwparker

@nwparker nwparker commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​6 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1
Prod 0 0 0 0

ELI5

A test checks that the faster way of showing a long chat reply as it streams produces exactly the same page as the old way, at every step. It did that on documents of about 50,000 characters, rendering each one up to 85 times with both renderers. On a busy CI runner one case took 43 seconds and another ran past its 55-second limit. The documents are now about a quarter to a seventh of that size, with the same shapes, so each case finishes in seconds.

What Changed

Before: in CommentMarkdown.parse-reuse.test.tsx › "preserves exact DOM and copy text at every reveal update":

  • the paragraph case was 50,000 characters, revealed from 40,000
  • the fence case was 1,400 code lines (56,011 characters), revealed from 40,000
  • the list case was 650 items (47,990 characters), revealed from 35,000

On CI (#35341, job 123096980923) the paragraph case took 43 s and the list case hit the 55 s timeout. The Vitest EISDIR bug fixed in #35384 hid that failure.

After:

  • paragraph: 12,500 characters, revealed from 10,000 (the same 80% point)
  • fence: 350 lines (14,011 characters), revealed from 10,000 (71%, as before)
  • list: 100 items (7,290 characters), revealed from 5,350 (73%, as before)

Every other case (short, settled fence and tail, the boundary and construct cases) and the two other tests are unchanged.

Mechanism: only the three large documents and their reveal start points change. They keep the same block kinds (a long paragraph, one long fence, a long run of list items), the same production reveal cadence (sequence(), 85 frames), and the same position of the reveal within the document. Both renderers are still compared after every update.

Why

What the test covers: that block reuse matches a full re-parse on long streamed replies. I found no size threshold in CommentMarkdown or the block splitter that needs 50k-character documents. The longer documents only added render time per frame, which is what made the test depend on runner speed.

Times on my machine, which was loaded:

Case Before After
paragraph 26–38 s 4.5–6.5 s
list 34 s 6 s
fence 5.3 s 1–1.7 s

On CI the same ratio puts the slowest case at about 10 s against the 55 s timeout.

Alternatives considered: raising the timeout keeps the test runner-speed dependent and slows every shard. Splitting the cases out doesn't reduce the work.

Flag-off: test-only.

User-risk: none.

Linked Issue

CI flake triage (unit shards blocking merges). Follows #34821, which added the test.

Visual Proof

N/A. Test-only.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

The file passes, 14/14, twice. Timings are in the Why section.

Checks run: pnpm tc, pnpm run typecheck:ci, pnpm run check:code-quality:changed, anti-slop oxlint, oxlint, ast-grep scan and gates.

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

None.

Status

Ready for review.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@nwparker

Copy link
Copy Markdown
Contributor Author

STATUS: ready. Head 3aab486, from origin/main bb1b05e. The three large reveal documents shrink to 12.5k/14k/7.3k characters with the same block shapes and reveal-start ratios. Local timing (loaded machine): paragraph 26–38 s → 4.5–6.5 s, list 34 s → 6 s. Checks: pnpm tc, typecheck:ci, code-quality, anti-slop, oxlint, ast-grep scan and gates; the file passes 14/14. Review requested from e9-reviewer.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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 21 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 73dfa68a-7d32-4786-9c96-41df0d296061
Commits

Reviewing files that changed from the base of the PR and between 93ff483 and 3aab486.

Files selected for processing: 1
  • src/renderer/src/components/sidebar/CommentMarkdown.parse-reuse.test.tsx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This test-only change appears safe to merge.

Summary

Reduces the paragraph, fence, and list fixtures and adjusts their reveal start points to reduce test time on busy CI runners.

  • Large streamed-reveal test cases render less text at each update.

Reviews (1) · Last reviewed commit: "test(markdown): size the streamed-reveal..." · Reviewed by Greptile

@nwparker
nwparker merged commit 8e52ada into main Oct 28, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant