next.js
9c8b238a - test: stabilize deferred entries HMR assertions (#98418)

Commit
13 days ago
test: stabilize deferred entries HMR assertions (#98418) ### What? Stabilize the deferred-entries development-mode HMR assertions by giving condition-based callback, rendered-output, and page-content polling an HMR-appropriate retry budget. ### Why? Canary CI repeatedly observed the previous callback timestamp after a non-deferred edit. The logs show webpack detecting and compiling the edit, while its multi-compiler HMR cycle—including the edge compiler—finishes after the generic three-second retry window. The deferred callback is scheduled after that cycle, so these failures reflect the harness timing out before valid product behavior rather than a deferred-entries product defect. ### How? Use a shared ten-second retry duration only for the six HMR-observable polls in the existing dev-only tests. The checks still wait on real callback timestamps, rendered values, and updated page content. Existing ordering and callback-stability assertions remain unchanged, so missing callbacks, stale rendering, and callback loops continue to fail. ### Verification - `pnpm test-dev-webpack test/e2e/deferred-entries/deferred-entries.test.ts` (3 consecutive runs, 23/23 each, with CI environment mirrored) - `pnpm test-dev-turbo test/e2e/deferred-entries/deferred-entries.test.ts` (23/23) - `pnpm prettier --with-node-modules --ignore-path .prettierignore --write test/e2e/deferred-entries/deferred-entries.test.ts` - `npx eslint --config eslint.config.mjs --fix test/e2e/deferred-entries/deferred-entries.test.ts` <!-- NEXT_JS_LLM --> <!-- fleet 3cae6bf2-a515-4375-8814-03055b906f2a --> Co-authored-by: vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by: Tobias Koppers <1365881+sokra@users.noreply.github.com>
Author
Parents
Loading