Repository navigation
test(web): PDF preview tests wait on pdf.js loads and stop timing out - #31104
Conversation
The workspace PDF scroll and zoom test did five document loads and more than twenty bounded waits inside its 15 s budget, and ran out of time under load. Replace it and the five-reload clamp test with one test that awaits each pdf.js load, and move the restore arithmetic into pdfLayout with a unit test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — The assessed change extracts PDF preview scroll-restoration calculations into a reusable helper while retaining existing positioning behavior and guards. Its limited UI scope presents no obvious material risk requiring human judgment. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
**v0.1.8-nightly.20261104.4192** · 10 changes from 1 contributor **2 bug fixes.** <details> <summary>Full changelog</summary> ## What's Changed * fix(relay): use released drizzle rc.5 and fail installs on unmet peers by @juliusmarminge in pingdotgg/t3code#31016 * build: typecheck with tsrs and Effect's rules through @effect/tsgo by @juliusmarminge in pingdotgg/t3code#31028 * refactor: replace jose with effect/jose by @juliusmarminge in pingdotgg/t3code#30474 * refactor: move HMAC, key, and random work to effect/crypto by @juliusmarminge in pingdotgg/t3code#30501 * refactor(server): sign server tokens through PayloadSigner by @juliusmarminge in pingdotgg/t3code#30523 * refactor: hold relay signing keys in EnvironmentSigningKey and CloudMintSigner by @juliusmarminge in pingdotgg/t3code#30529 * refactor(client-runtime): share DPoP proof creation across web and mobile by @juliusmarminge in pingdotgg/t3code#30540 * fix(client-runtime): a thread keeps syncing after a stream defect by @juliusmarminge in pingdotgg/t3code#31071 * test(server): AgentSessionScanner blocked-repo test no longer races the git-read timeout by @juliusmarminge in pingdotgg/t3code#30554 * test(web): PDF preview tests wait on pdf.js loads and stop timing out by @juliusmarminge in pingdotgg/t3code#31104 **Full Changelog**: pingdotgg/t3code@v0.1.8-nightly.20261104.4179...v0.1.8-nightly.20261104.4192 </details> Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.8-nightly.20261104.4192
The PDF preview browser tests have been flaky since they landed. CI run 41699885540 failed "keeps workspace PDF scroll and zoom after reloads" at
getByText('1 / 3 pages')with the viewer still on "Loading file". Locally under load the same test fails in the same way: it does five full pdf.js document loads and more than twenty 1 s poll waits inside its 15 s budget, and a busy machine runs it past the cap (failures at 14.9 s, with clicks left 1–632 ms). Waiting on pdf.js before reading the page count, as https://git.cafe/pingdotgg/t3code/pulls/30328 did, cannot fix this, because the problem is the test's total length, not one wait.Per-test decisions
Loops are cold
vp test runprocesses with 16yes > /dev/nullprocesses running on a 16-core machine (load average ~25). Before: 40 runs. After: 100 runs, as two concurrent loops of 50, every PDF test in each run.The new test does three loads. Before each check it awaits the document pdf.js opens (
task.promise) and every page size, through a smallopenPdfwrapper in the test file, instead of relying on a 1 s poll. It checks that a revision reload keeps the page, the page-relative offset (the new revision has a taller first page, so only a page-relative restore passes), horizontal scroll and zoom, that no new pdf.js worker starts (https://git.cafe/pingdotgg/t3code/pulls/29626), and that opening another file starts at the top in fit width. Mutation checks: dropping the view carried into the new revision, and starting a worker per document, each make it fail.Coverage moved or removed
pdfRestoredScrollTopinpdfLayout.test.ts. The arithmetic moved out ofPdfViewer'srestoreViewunchanged; that test also covers scaling a saved offset to a new width (https://git.cafe/pingdotgg/t3code/pulls/25496).No component bug found: every local failure was the budget running out while loads were still in progress, never a load that did not finish.
Replaces https://git.cafe/pingdotgg/t3code/pulls/30328.
Model: Claude Opus 5.5 (claude-opus-5-5), Claude Code harness in T3 Code.
🤖 Generated with Claude Code