[test] Update OTEL span expectations for blocking prerenders

An unknown slug now blocks for prerendering before its first response.
The first and repeat requests therefore use the same cached span IDs.
This removes the test's expectation of a separate background prerender.
parent 89794770
...@@ -6,7 +6,7 @@ import { ...@@ -6,7 +6,7 @@ import {
} from 'next-test-utils' } from 'next-test-utils'
describe('cache-components OTEL spans', () => { describe('cache-components OTEL spans', () => {
const { next, isTurbopack, isNextDeploy } = nextTestSetup({ const { next, isTurbopack } = nextTestSetup({
files: __dirname, files: __dirname,
dependencies: require('./package.json').dependencies, dependencies: require('./package.json').dependencies,
// This test sometimes takes longer than the default timeout, extending it bit longer // This test sometimes takes longer than the default timeout, extending it bit longer
...@@ -327,29 +327,8 @@ describe('cache-components OTEL spans', () => { ...@@ -327,29 +327,8 @@ describe('cache-components OTEL spans', () => {
const t8again = await browser.elementByCss('#t8 .span') const t8again = await browser.elementByCss('#t8 .span')
const t8againValue = parseInt(await t8again.textContent()) const t8againValue = parseInt(await t8again.textContent())
// this page was cached so the spans should be cached too // this page was cached so the spans should be cached too
// TODO: Normally we'd expect the first request to be a blocking expect(t7againValue).toEqual(t7value)
// prerender for the unknown param, which means the served response is expect(t8againValue).toEqual(t8value)
// the same response that's saved and served on subsequent requests.
// However, this appeared to have regressed recently with `next start`,
// so instead a dynamic SSR response is served on the first request, and
// in the background the prerendered response is generated and saved for
// subsequent requests. This means the first request's span values are
// different from the second request's span values. When this regression
// is fixed, the following assertions should be consolidated to just
// assert that the second request's span values equal the first
// request's span values. The failure is masked in CI because of the
// built-in jest retry. On the retry attempt the requests use the
// prerendered response from the first attempt, thus making the test
// succeed. That retry behavior is disabled though when the test is run
// in the flaky detection CI job, which is why it fails whenever it is
// touched.
if (isNextDeploy) {
expect(t7againValue).toEqual(t7value)
expect(t8againValue).toEqual(t8value)
} else {
expect(t7againValue).not.toEqual(t7value)
expect(t8againValue).not.toEqual(t8value)
}
} }
}) })
it('should allow creating Spans during resuming a fallback - inside a Cache Component', async () => { it('should allow creating Spans during resuming a fallback - inside a Cache Component', async () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment