Repository navigation
fix: deflake the markdown react-parity lane and surface real batch timeout errors - #740
Merged
Merged
Conversation
…meout errors The markdown conformance public-api probe imports src/index inside the test body, so the package's first Octane compile counted against vitest's 5s default testTimeout and intermittently lost the race under the 136-lane parity batch. The markdown project now carries the repo's 30s compile-heavy timeout convention. The batch also reported such timeouts as 'Error: STACK_TRACE_ERROR' because vitest's JSON reporter serializes error.stack alone while makeTimeoutError keeps the real message only on error.message. A thin JsonReporter subclass re-embeds the message into the stack before serialization, wired into the parity batch, the harness single-lane vitest runners, and the unhandled reporter. Co-Authored-By: Claude Fable 5 <[email protected]>
trueadm
marked this pull request as ready for review
August 12, 2026 19:17
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.
Summary
packages/markdown/tests/conformance/public-types.test.tsinside the parity-wide Vitest batch (node scripts/react-parity/check.mjs), which passed 100% standalone but failed ~2 of 3 full runs with an unreadableError: STACK_TRACE_ERROR.Test timed out in Nms…message now serializes into the batch report instead of the placeholder.Why
await import('../../src/index')inside the test body (siblings import at module top level, which is collection-time and exempt fromtestTimeout). Themarkdownproject had no timeout override, so vitest's 5s default applied; the import costs ~460ms standalone but pays the package's first Octane-plugin compile, which intermittently exceeds 5s under 136-lane batch contention. Forcing--testTimeout=50through the same pipeline reproduces the reported failure byte-for-byte, confirming timeout (not a worker crash — a crash would trip the batch's coverage check instead of reporting a failed assertion).@vitest/runner'smakeTimeoutErrorkeeps the real message only onerror.messageand reuses the placeholder stack captured atit()registration (headerError: STACK_TRACE_ERROR), while the JSON reporter serializeserror.stack || error.message— dropping the message.Changes
vitest.config.js:markdownproject getstestTimeout/hookTimeout: 30_000, matching the repo convention for compile-heavy projects (the sharded CI config derives from base, so it inherits). Placed in config rather than the test file because markdown's audit crosswalk pins the test files' identities.scripts/react-parity/vitest-json-reporter.mjs(new):JsonReportersubclass that re-embeds each error's message into its stack before serialization, sofailureMessagesalways carries the real failure. Replaces--reporter=jsonin the parity batch (check-lib.mjs), the harness single-lane vitest runners (harness-lib.mjs), and backs the unhandled reporter's formatting.scripts/react-parity/check-lib.test.mjs: regression tests for the stack repair (timeout placeholder, already-embedded, headerless) and for end-to-end serialization through the realJsonReporter; argv expectations updated here and inharness-lib.test.mjs.packages/octane-evals/datasets/train/user-apps-v1/manifest.jsonl: regenerated bypnpm sync— the eval grader digest hashes the rootvitest.config.js, so every task'sgraderDigestmoves with the config edit.Validation
pnpm format:checkpnpm typecheckpnpm test(full local run: 20,917/20,921 passed; the 4 failures are pre-existing local flakes unrelated to this diff — doom-production browser matcher timeout and native-change checkbox ordering both pass standalone on rerun, and the swr focus/reconnect race predates this change and is tracked separately)pnpm react-parity:test(464/464, includes the new regression tests);pnpm ci:workflow:test(87/87);markdown+markdown-differentialprojects under the root config (176/176);check.mjs --validate-onlygreen after the config editcheck.mjsruns failed on it); forced--testTimeout=50now reportsError: Test timed out in 50ms.with the registration-site frames instead of the placeholdercheck.mjscannot exit 0 on macOS regardless of this change: the drei pristine Playwright lane ships only a-linux.pngsnapshot baseline (pre-existing, unrelated). One batch run also surfaced a distinct swr focus/reconnect flake that fails ~1-in-3 standalone — readable in the report thanks to the new reporter; tracked separately.Risk / follow-ups
packages/swr/tests/upstream/root/root.test.ts.Provenance
agent-authored)Note
Low Risk
Changes are limited to test timeouts, CI reporter wiring, and eval digest metadata; the reporter only adjusts error stacks when the message is missing from the serialized stack.
Overview
Addresses intermittent markdown react-parity batch failures and unreadable
Error: STACK_TRACE_ERRORreports when tests hit Vitest’s default timeout under heavy batch contention.The markdown Vitest project now uses 30s
testTimeoutandhookTimeoutso the compile-heavy in-testimportin the public-types probe can finish during wide parity runs. Parity and harness Vitest invocations swap--reporter=jsonfor a newvitest-json-reporterthat rewrites timeout (and similar) errors sofailureMessagesinclude the real message, not only Vitest’s registration-time placeholder stack; the unhandled reporter reuses the same repair.user-apps-v1/manifest.jsonlis regenerated so each task’sgraderDigestmatches the updated rootvitest.config.js.Reviewed by Cursor Bugbot for commit 361df28. Bugbot is set up for automated code reviews on this repo. Configure here.