test(app-basepath): increase waitForElementByCss timeout for hard-nav test - #91920
Conversation
… test In dev mode, navigating from a Pages Router page to an App Router page triggers on-demand compilation, which can exceed the default 10s timeout before #page-2 appears. Raise the timeout to 30s to avoid the flake. Co-Authored-By: Claude <noreply@anthropic.com>
Failing test suitesCommit: 61223a5 | About building and testing Next.js
Expand output● page features telemetry › production mode › should detect app page counts ● page features telemetry › production mode › detects reportWebVitals with no _app correctly for
Expand output● next/dynamic › production mode › should load a Pages Router page correctly ● next/dynamic › production mode › should load a App Router page correctly
Expand output● after() in static pages › runs after during build
Expand output● app dir client cache with parallel routes › prefetch={true} › should re-use the cache for the full page, only for 5 mins
Expand output● segment cache (basic tests) › navigate with prefetched data
Expand output● Graceful Shutdown › production (next start) › should not accept new requests during shutdown cleanup › should stop accepting new requests when shutting down ● Graceful Shutdown › production (standalone mode) › should not accept new requests during shutdown cleanup › should stop accepting new requests when shutting down |
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URL |
What?
Increase the
waitForElementByCss('#page-2', ...)timeout in theapp dir - basepath › should successfully hard navigate from pages -> apptest from the default 10 s to 30 s.Why?
Datadog test runs
The test navigates from a Pages Router page (
/base/pages-path) to an App Router page (/base/another) via a hard (non-client-side) navigation. In dev mode, the destination App Router page is compiled on demand the first time it is visited. That compilation can take longer than the default 10 swaitForElementByCsstimeout, causing the test to fail spuriously with:How?
Pass
30000(30 s) as the second argument towaitForElementByCss. This matches the pattern used elsewhere in the test suite for dev-mode tests that are subject to on-demand compilation latency. No runtime code changes are needed — this is purely a test-side fix.