Skip to content

Commit 918a534

Browse files
authored
fix Turbopack devlow bench (vercel#73278)
### What? fix TURBO_CACHE env var cleanup devlow bench script
1 parent eaf63e7 commit 918a534

File tree

2 files changed

+8
-34
lines changed

2 files changed

+8
-34
lines changed

bench/heavy-npm-deps/next.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const nextConfig = {
88
},
99
experimental: {
1010
turbo: {
11-
unstablePersistentCaching: process.env.TURBO_CACHE ? true : false,
11+
unstablePersistentCaching: process.env.TURBO_CACHE === '1',
1212
},
1313
},
1414
}

scripts/devlow-bench.mjs

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,7 @@ const nextBuildWorkflow =
3838
NODE: process.env.NODE,
3939
HOSTNAME: process.env.HOSTNAME,
4040
PWD: process.env.PWD,
41-
// Disable otel initialization to prevent pending / hanging request to otel collector
42-
OTEL_SDK_DISABLED: 'true',
43-
NEXT_PUBLIC_OTEL_SENTRY: 'true',
44-
NEXT_PUBLIC_OTEL_DEV_DISABLED: 'true',
4541
NEXT_TRACE_UPLOAD_DISABLED: 'true',
46-
// Enable next.js test mode to get HMR events
47-
__NEXT_TEST_MODE: '1',
4842
}
4943

5044
const serverEnv = {
@@ -156,34 +150,14 @@ const nextBuildWorkflow =
156150
'lines'
157151
)
158152

159-
if (turbopack) {
160-
// close dev server and browser
161-
await killShell()
162-
await closeSession()
163-
} else {
164-
// wait for persistent cache to be written
165-
const waitPromise = new Promise((resolve) => {
166-
setTimeout(resolve, 5000)
167-
})
168-
const cacheLocation = join(
169-
benchmarkDir,
170-
'.next',
171-
'cache',
172-
'webpack',
173-
'client-production'
174-
)
175-
await Promise.race([
176-
waitForFile(join(cacheLocation, 'index.pack')),
177-
waitForFile(join(cacheLocation, 'index.pack.gz')),
178-
])
179-
await measureTime('cache created')
180-
await waitPromise
181-
await measureTime('waiting')
153+
// close browser
154+
await killShell()
155+
await closeSession()
182156

183-
// close dev server and browser
184-
await killShell()
185-
await closeSession()
186-
}
157+
await measureTime('before build with cache', {
158+
scenario: benchmarkName,
159+
props: { turbopack, page },
160+
})
187161

188162
buildShell = command('pnpm', buildArgs, {
189163
cwd: benchmarkDir,

0 commit comments

Comments
 (0)