Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

special case timeout on windows #56120

Merged
merged 3 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 20 additions & 24 deletions packages/next/src/build/collect-build-traces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,11 @@ export async function collectBuildTraces({
'**/node_modules/sharp/**/*',
]
: []),

...(!hasSsrAmpPages
? ['**/next/dist/compiled/@ampproject/toolbox-optimizer/**/*']
: []),

...additionalIgnores,

...(isStandalone ? [] : TRACE_IGNORES),
Expand Down Expand Up @@ -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],
Expand All @@ -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)
Expand All @@ -369,7 +361,9 @@ export async function collectBuildTraces({
contains: true,
})
) {
tracedFiles.add(path.relative(distDir, filePath))
tracedFiles.add(
path.relative(distDir, filePath).replace(/\\/g, '/')
)
}
}
}
Expand Down Expand Up @@ -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, '/')
)
}
}
Expand Down Expand Up @@ -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)
})
}
}
}

Expand Down
5 changes: 4 additions & 1 deletion test/lib/e2e-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading