next.js
3c86d2f5 - Add a test for use cache entries surviving a page add and remove in dev

Commit
13 days ago
Add a test for use cache entries surviving a page add and remove in dev Turbopack advances the HMR refresh hash — which is part of every "use cache" key — once per change-subscription emission, and an entry's subscription can emit without an edit: adding or removing an unrelated page is enough. When such an emission lands between two page loads, every cached entry is discarded. The test adds a page, waits until it's servable, and asserts the cached value didn't change; then removes it, waits for the 404, pushes another page addition through as a barrier, and asserts again. Whether an emission lands inside an observed window depends on timing, so before the fix this fails intermittently rather than every run — one of five runs in CI's flake detection at the previous commit. Webpack refreshes its hash on a different trigger, fixed in the previous commit, so the test passes there already.
Author
Committer
Parents
Loading