Unverified Commit bd2c871e authored by Niklas Mischkulnig's avatar Niklas Mischkulnig Committed by GitHub

Skip filesystem-cache.test.ts test with Webpack (#86506)

It's very flakey with Webpack
parent 6bfd8184
/* eslint-disable jest/no-standalone-expect */
import { nextTestSetup, isNextDev } from 'e2e-utils' import { nextTestSetup, isNextDev } from 'e2e-utils'
import { waitFor } from 'next-test-utils' import { waitFor } from 'next-test-utils'
process.env.NEXT_PUBLIC_ENV_VAR = 'hello world'
// Make it easier to run in development, test directories are cleared between runs already so this is safe.
process.env.TURBO_ENGINE_IGNORE_DIRTY = '1'
// decrease the idle timeout to make the test more reliable
process.env.TURBO_ENGINE_SNAPSHOT_IDLE_TIMEOUT_MILLIS = '1000'
for (const cacheEnabled of [false, true]) { for (const cacheEnabled of [false, true]) {
describe(`filesystem-caching with cache ${cacheEnabled ? 'enabled' : 'disabled'}`, () => { describe(`filesystem-caching with cache ${cacheEnabled ? 'enabled' : 'disabled'}`, () => {
beforeAll(() => {
process.env.NEXT_PUBLIC_ENV_VAR = 'hello world'
})
afterAll(() => {
delete process.env.NEXT_PUBLIC_ENV_VAR
})
let envVars = [
`ENABLE_CACHING=${cacheEnabled ? '1' : ''}`,
// Make it easier to run in development, test directories are cleared between runs already so this is safe.
`TURBO_ENGINE_IGNORE_DIRTY=1`,
// decrease the idle timeout to make the test more reliable
`TURBO_ENGINE_SNAPSHOT_IDLE_TIMEOUT_MILLIS=1000`,
].join(' ')
const { skipped, next, isTurbopack } = nextTestSetup({ const { skipped, next, isTurbopack } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true, skipDeployment: true,
packageJson: { packageJson: {
scripts: { scripts: {
build: `ENABLE_CACHING=${cacheEnabled ? '1' : ''} next build`, build: `${envVars} next build`,
dev: `ENABLE_CACHING=${cacheEnabled ? '1' : ''} next dev`, dev: `${envVars} next dev`,
start: 'next start', start: 'next start',
}, },
}, },
...@@ -56,7 +66,10 @@ for (const cacheEnabled of [false, true]) { ...@@ -56,7 +66,10 @@ for (const cacheEnabled of [false, true]) {
await next.start() await next.start()
} }
it('should cache or not cache loaders', async () => { // Very flakey with Webpack enabled
;(process.env.IS_TURBOPACK_TEST ? it : it.skip)(
'should cache or not cache loaders',
async () => {
let appTimestamp, unchangedTimestamp, appClientTimestamp, pagesTimestamp let appTimestamp, unchangedTimestamp, appClientTimestamp, pagesTimestamp
{ {
const browser = await next.browser('/') const browser = await next.browser('/')
...@@ -128,7 +141,8 @@ for (const cacheEnabled of [false, true]) { ...@@ -128,7 +141,8 @@ for (const cacheEnabled of [false, true]) {
} }
await browser.close() await browser.close()
} }
}) }
)
function makeTextCheck(url: string, text: string) { function makeTextCheck(url: string, text: string) {
return textCheck.bind(null, url, text) return textCheck.bind(null, url, text)
...@@ -246,7 +260,10 @@ for (const cacheEnabled of [false, true]) { ...@@ -246,7 +260,10 @@ for (const cacheEnabled of [false, true]) {
]) ])
for (const [name, changes] of combinations) { for (const [name, changes] of combinations) {
it(`should allow to change files while stopped (${name})`, async () => { // Very flakey with Webpack enabled
;(process.env.IS_TURBOPACK_TEST ? it : it.skip)(
`should allow to change files while stopped (${name})`,
async () => {
let fullInvalidation = !cacheEnabled let fullInvalidation = !cacheEnabled
for (const change of changes) { for (const change of changes) {
await change.checkInitial() await change.checkInitial()
...@@ -307,7 +324,9 @@ for (const cacheEnabled of [false, true]) { ...@@ -307,7 +324,9 @@ for (const cacheEnabled of [false, true]) {
expect(unchangedTimestamp).toEqual(timestamp) expect(unchangedTimestamp).toEqual(timestamp)
await browser.close() await browser.close()
} }
}, 200000) },
200000
)
} }
}) })
} }
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