Repository: vercel/next.js
Pull request: [test] Skip failing segment-cache deploy test

Breaks deploy test but not considered block by @acdlite so we should skip in the meantime.

---
[Slack Thread](https://vercel.slack.com/archives/C04KC8A53T7/p1771984303496539?thread_ts=1771984303.496539&cid=C04KC8A53T7)

<p><a href="https://cursor.com/agents/bc-47b7a189-6876-5371-816d-03d8c993cb31"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/background-agent?bcId=bc-47b7a189-6876-5371-816d-03d8c993cb31"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</p>



Changed files:
filename: test/e2e/app-dir/segment-cache/basic/segment-cache-basic.test.ts
patch: @@ -3,7 +3,7 @@ import { createRouterAct } from 'router-act'
 import { waitFor } from 'next-test-utils'
 
 describe('segment cache (basic tests)', () => {
-  const { next, isNextDev } = nextTestSetup({
+  const { next, isNextDev, isNextDeploy } = nextTestSetup({
     files: __dirname,
   })
   if (isNextDev) {
@@ -277,71 +277,75 @@ describe('segment cache (basic tests)', () => {
     expect(await dynamicDiv.innerHTML()).toBe('Dynamic page')
   })
 
-  it('refreshes page segments when navigating to the exact same URL as the current location', async () => {
-    let act: ReturnType<typeof createRouterAct>
-    const browser = await next.browser('/same-page-nav', {
-      beforePageLoad(page) {
-        act = createRouterAct(page)
-      },
-    })
-
-    const linkWithNoHash = await browser.elementByCss(
-      'a[href="/same-page-nav"]'
-    )
-    const linkWithHashA = await browser.elementByCss(
-      'a[href="/same-page-nav#hash-a"]'
-    )
-    const linkWithHashB = await browser.elementByCss(
-      'a[href="/same-page-nav#hash-b"]'
-    )
-
-    async function readRandomNumberFromPage() {
-      const randomNumber = await browser.elementById('random-number')
-      return await randomNumber.textContent()
-    }
-
-    // Navigating to the same URL should refresh the page
-    const randomNumber = await readRandomNumberFromPage()
-    await act(async () => {
-      await linkWithNoHash.click()
-    }, [
-      {
-        includes: 'random-number',
-      },
-      {
-        // Only the page segments should be refreshed, not the layouts.
-        // TODO: We plan to change this in the future.
-        block: 'reject',
-        includes: 'same-page-nav-layout',
-      },
-    ])
-    const randomNumber2 = await readRandomNumberFromPage()
-    expect(randomNumber2).not.toBe(randomNumber)
-
-    // Navigating to a different hash should *not* refresh the page
-    await act(async () => {
-      await linkWithHashA.click()
-    }, 'no-requests')
-    expect(await readRandomNumberFromPage()).toBe(randomNumber2)
-
-    // Navigating to the same hash again should refresh the page
-    await act(
-      async () => {
-        await linkWithHashA.click()
-      },
-      {
-        includes: 'random-number',
+  // TODO: Fix same-page navigation refresh behavior in deploy mode
+  ;(isNextDeploy ? it.skip : it)(
+    'refreshes page segments when navigating to the exact same URL as the current location',
+    async () => {
+      let act: ReturnType<typeof createRouterAct>
+      const browser = await next.browser('/same-page-nav', {
+        beforePageLoad(page) {
+          act = createRouterAct(page)
+        },
+      })
+
+      const linkWithNoHash = await browser.elementByCss(
+        'a[href="/same-page-nav"]'
+      )
+      const linkWithHashA = await browser.elementByCss(
+        'a[href="/same-page-nav#hash-a"]'
+      )
+      const linkWithHashB = await browser.elementByCss(
+        'a[href="/same-page-nav#hash-b"]'
+      )
+
+      async function readRandomNumberFromPage() {
+        const randomNumber = await browser.elementById('random-number')
+        return await randomNumber.textContent()
       }
-    )
-    const randomNumber3 = await readRandomNumberFromPage()
-    expect(randomNumber3).not.toBe(randomNumber2)
 
-    // Navigating to a different hash should *not* refresh the page
-    await act(async () => {
-      await linkWithHashB.click()
-    }, 'no-requests')
-    expect(await readRandomNumberFromPage()).toBe(randomNumber3)
-  })
+      // Navigating to the same URL should refresh the page
+      const randomNumber = await readRandomNumberFromPage()
+      await act(async () => {
+        await linkWithNoHash.click()
+      }, [
+        {
+          includes: 'random-number',
+        },
+        {
+          // Only the page segments should be refreshed, not the layouts.
+          // TODO: We plan to change this in the future.
+          block: 'reject',
+          includes: 'same-page-nav-layout',
+        },
+      ])
+      const randomNumber2 = await readRandomNumberFromPage()
+      expect(randomNumber2).not.toBe(randomNumber)
+
+      // Navigating to a different hash should *not* refresh the page
+      await act(async () => {
+        await linkWithHashA.click()
+      }, 'no-requests')
+      expect(await readRandomNumberFromPage()).toBe(randomNumber2)
+
+      // Navigating to the same hash again should refresh the page
+      await act(
+        async () => {
+          await linkWithHashA.click()
+        },
+        {
+          includes: 'random-number',
+        }
+      )
+      const randomNumber3 = await readRandomNumberFromPage()
+      expect(randomNumber3).not.toBe(randomNumber2)
+
+      // Navigating to a different hash should *not* refresh the page
+      await act(async () => {
+        await linkWithHashB.click()
+      }, 'no-requests')
+      expect(await readRandomNumberFromPage()).toBe(randomNumber3)
+    }
+  )
 
   it('does not throw an error when navigating to a page with a server action', async () => {
     let act: ReturnType<typeof createRouterAct>