Skip to content

test(rsc): make progressive streaming e2e tests independent of fixed sleeps - #8713

Merged
Sheraff merged 1 commit into
mainfrom
test/rsc-stream-progressive
Oct 14, 2026
Merged

Sheraff merged 1 commit into
mainfrom
test/rsc-stream-progressive

Conversation

@Sheraff

@Sheraff Sheraff commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

The "Notifications stream in progressively" tests in e2e/react-start/rsc (rsc-stream-generator and rsc-stream-readable) clicked start, slept 500 ms, and expected the initial batch of 3 notifications to be rendered.

The server sends that batch in a single chunk within ~40 ms, but React throttles Suspense reveals by 300 ms (FALLBACK_THROTTLE_MS). When later notifications in the batch suspend briefly, they appear one throttle tick after the first (~670 ms after the click locally), which is past the 500 ms window. This is valid app behavior, so the test was asserting a timing React doesn't guarantee.

It surfaced in #8708 (srvx 1.x): the Rsbuild shard failed 3/3 in CI, and passed when only this app was put back on srvx 0.10. The streamed bytes are identical between srvx versions; the different static asset serving shifts the browser timing enough to hit the throttle more often. Locally, pinned to 2 busy CPU cores, the old test fails ~50% on both srvx 0.10.1 and 1.0.5.

Change

Instead of fixed sleeps, the test now:

  1. waits for the 3rd notification to be visible,
  2. asserts the stream is still open (streaming-status visible) and fewer than all 7 notifications are rendered, which is what "progressive" means,
  3. waits for the next notification, then for completion with exactly 7.

The only remaining timing assumption is that the browser renders the first batch before the server finishes its 4 × 800 ms delays (~3 s margin).

Validation

  • tanstack-react-start-e2e-rsc:test:e2e (Vite + Rsbuild, all shards)
  • The two updated tests under 2-core CPU contention, 10 repeats × 2 rounds, on both srvx 0.10.1 and 1.0.5: 80/80 passed (the old version failed ~50% in the same setup)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Updated progressive-streaming checks to verify that notifications appear before the stream completes and that all seven are shown afterward.
    • Replaced timing-based checks with assertions that wait for notifications and stream completion. This improves confidence that notifications are displayed correctly as updates arrive.

The progressive-streaming tests slept 500ms and expected the initial batch
of 3 notifications to be rendered. React throttles Suspense reveals by
300ms, so the batch can legitimately land after that window. Wait for the
3rd notification, assert the stream is still open with fewer than all
notifications, then wait for the next one and for completion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Oct 14, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 966ad23

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@nx-cloud

nx-cloud Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 966ad23

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 7m 53s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 2m 4s View ↗

☁️ Nx Cloud last updated this comment at 2026-10-14 13:00:31 UTC

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

3 package(s) bumped directly, 11 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/router-cli 1.167.43 → 1.167.44 Changeset
@tanstack/router-utils 1.162.3 → 1.162.4 Changeset
@tanstack/start-server-core 1.169.42 → 1.169.43 Changeset
@tanstack/react-start 1.169.1 → 1.169.2 Dependent
@tanstack/react-start-rsc 0.1.62 → 0.1.63 Dependent
@tanstack/react-start-server 1.167.49 → 1.167.50 Dependent
@tanstack/router-generator 1.167.43 → 1.167.44 Dependent
@tanstack/router-plugin 1.168.45 → 1.168.46 Dependent
@tanstack/router-vite-plugin 1.167.45 → 1.167.46 Dependent
@tanstack/solid-start 1.169.1 → 1.169.2 Dependent
@tanstack/solid-start-server 1.167.47 → 1.167.48 Dependent
@tanstack/start-plugin-core 1.171.52 → 1.171.53 Dependent
@tanstack/vue-start 1.169.1 → 1.169.2 Dependent
@tanstack/vue-start-server 1.167.47 → 1.167.48 Dependent

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: TanStack/router/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 531eb661-a87b-4553-830b-4893d4e7225e
📥 Commits

Reviewing files that changed from the base of the PR and between 71d9694 and 966ad23.

📒 Files selected for processing: 2
  • e2e/react-start/rsc/tests/rsc-stream-generator.spec.ts
  • e2e/react-start/rsc/tests/rsc-stream-readable.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📝 Walkthrough

Both RSC progressive-streaming tests replace fixed delays and count comparisons with locator-based checks. They verify notifications appear while streaming is active, wait for another notification and stream completion, then confirm exactly seven notifications.

Changes: RSC progressive-streaming tests

Layer / File(s) Summary
Progressive-streaming assertions
e2e/react-start/rsc/tests/rsc-stream-generator.spec.ts, e2e/react-start/rsc/tests/rsc-stream-readable.spec.ts
Both tests check that notifications render before streaming completes, wait for another notification and stream completion, and assert a final count of seven.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 966ad

The updated streaming tests have no identified issue that needs fixing before merge.

Pre-merge checks: Passed 5
Passed Passed checks: 5 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: replacing fixed sleeps in progressive streaming end-to-end tests.
Description check Passed The description clearly explains the problem, the test changes, the motivation, and validation results. It does not reproduce the template checklist or explicitly state the release impact, but the sub…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • 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.

@pkg-pr-new

pkg-pr-new Bot commented Oct 14, 2026

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@8713

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@8713

@tanstack/eslint-plugin-start

npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@8713

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@8713

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@8713

@tanstack/react-router-devtools

npm i https://pkg.pr.new/@tanstack/react-router-devtools@8713

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@8713

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@8713

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@8713

@tanstack/react-start-rsc

npm i https://pkg.pr.new/@tanstack/react-start-rsc@8713

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@8713

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@8713

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@8713

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@8713

@tanstack/router-devtools-core

npm i https://pkg.pr.new/@tanstack/router-devtools-core@8713

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@8713

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@8713

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@8713

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@8713

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@8713

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@8713

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/@tanstack/solid-router-devtools@8713

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@8713

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@8713

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@8713

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@8713

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@8713

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@8713

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@8713

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@8713

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/@tanstack/start-static-server-functions@8713

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@8713

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@8713

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@8713

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@8713

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@8713

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@8713

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@8713

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@8713

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@8713

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@8713

commit: 966ad23

@Sheraff
Sheraff merged commit 08181cc into main Oct 14, 2026
10 checks passed
@Sheraff
Sheraff deleted the test/rsc-stream-progressive branch October 14, 2026 13:04
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