special case timeout on windows (#56120)

windows is slower so need to increase the timeout for that one
This commit is contained in:
JJ Kasper 2023-09-27 20:46:04 -07:00 committed by GitHub
parent 8f3eb01193
commit 2820b2bf4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 25 deletions

View file

@ -244,9 +244,11 @@ export async function collectBuildTraces({
'**/node_modules/sharp/**/*',
]
: []),
...(!hasSsrAmpPages
? ['**/next/dist/compiled/@ampproject/toolbox-optimizer/**/*']
: []),
...additionalIgnores,
...(isStandalone ? [] : TRACE_IGNORES),
@ -334,21 +336,11 @@ export async function collectBuildTraces({
})
const reasons = result.reasons
const fileList = result.fileList
result.esmFileList.forEach((file) => fileList.add(file))
for (const file of result.esmFileList) {
fileList.add(file)
}
const parentFilesMap = getFilesMapFromReasons(fileList, reasons)
const allEntryFiles = new Set<string>()
// get this from buildTraceContext
const entryFiles = new Set<string>()
entryFiles.forEach((file) => {
parentFilesMap
.get(path.relative(outputFileTracingRoot, file))
?.forEach((child) => {
allEntryFiles.add(path.join(traceContext, child))
})
})
for (const [entries, tracedFiles] of [
[serverEntries, serverTracedFiles],
@ -358,7 +350,7 @@ export async function collectBuildTraces({
const curFiles = parentFilesMap.get(
path.relative(outputFileTracingRoot, file)
)
tracedFiles.add(path.relative(distDir, file))
tracedFiles.add(path.relative(distDir, file).replace(/\\/g, '/'))
for (const curFile of curFiles || []) {
const filePath = path.join(outputFileTracingRoot, curFile)
@ -369,7 +361,9 @@ export async function collectBuildTraces({
contains: true,
})
) {
tracedFiles.add(path.relative(distDir, filePath))
tracedFiles.add(
path.relative(distDir, filePath).replace(/\\/g, '/')
)
}
}
}
@ -414,10 +408,12 @@ export async function collectBuildTraces({
)
for (const curFile of curFiles || []) {
curTracedFiles.add(
path.relative(
traceOutputDir,
path.join(outputFileTracingRoot, curFile)
)
path
.relative(
traceOutputDir,
path.join(outputFileTracingRoot, curFile)
)
.replace(/\\/g, '/')
)
}
}
@ -520,17 +516,17 @@ export async function collectBuildTraces({
for (const curGlob of includeGlobKeys) {
if (isMatch(page, [curGlob], { dot: true, contains: true })) {
outputFileTracingIncludes[curGlob].forEach((include) => {
combinedIncludes.add(include)
})
for (const include of outputFileTracingIncludes[curGlob]) {
combinedIncludes.add(include.replace(/\\/g, '/'))
}
}
}
for (const curGlob of excludeGlobKeys) {
if (isMatch(page, [curGlob], { dot: true, contains: true })) {
outputFileTracingExcludes[curGlob].forEach((exclude) => {
for (const exclude of outputFileTracingExcludes[curGlob]) {
combinedExcludes.add(exclude)
})
}
}
}

View file

@ -14,7 +14,10 @@ export type { NextInstance }
// if either test runs for the --turbo or have a custom timeout, set reduced timeout instead.
// this is due to current --turbo test have a lot of tests fails with timeouts, ends up the whole
// test job exceeds the 6 hours limit.
let testTimeout = shouldRunTurboDevTest() ? (240 * 1000) / 4 : 120 * 1000
let testTimeout = shouldRunTurboDevTest()
? (240 * 1000) / 4
: (process.platform === 'win32' ? 240 : 120) * 1000
if (process.env.NEXT_E2E_TEST_TIMEOUT) {
try {
testTimeout = parseInt(process.env.NEXT_E2E_TEST_TIMEOUT, 10)