Skip to content

devlow-bench: wait for complete ready for server startup event #77217

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

Merged
merged 1 commit into from
Mar 19, 2025
Merged
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
18 changes: 12 additions & 6 deletions scripts/devlow-bench.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { command } from '@vercel/devlow-bench/shell'
import { waitForFile } from '@vercel/devlow-bench/file'

const REPO_ROOT = fileURLToPath(new URL('..', import.meta.url))
const START_SERVER_REGEXP = /Ready in \d+/
const URL_REGEXP = /Local:\s+(?<url>.+)\n/

const GIT_SHA =
process.env.GITHUB_SHA ??
Expand Down Expand Up @@ -101,10 +103,12 @@ const nextBuildWorkflow =
cleanupTasks.push(killShell)

// wait for server to be ready
const START_SERVER_REGEXP = /Local:\s+(?<url>.+)\n/
const {
groups: { url },
} = await shell.waitForOutput(START_SERVER_REGEXP)
} = await shell.waitForOutput(URL_REGEXP)

// wait for server to be ready
await shell.waitForOutput(START_SERVER_REGEXP)
await measureTime('server startup', { props: { turbopack, page } })
await shell.reportMemUsage('mem usage after startup', {
props: { turbopack, page },
Expand Down Expand Up @@ -188,7 +192,7 @@ const nextBuildWorkflow =
// wait for server to be ready
const {
groups: { url: url2 },
} = await shell.waitForOutput(START_SERVER_REGEXP)
} = await shell.waitForOutput(URL_REGEXP)
await shell.reportMemUsage('mem usage after startup with cache')

// open page
Expand Down Expand Up @@ -279,10 +283,12 @@ const nextDevWorkflow =
cleanupTasks.push(killShell)

// wait for server to be ready
const START_SERVER_REGEXP = /Local:\s+(?<url>.+)\n/
const {
groups: { url },
} = await shell.waitForOutput(START_SERVER_REGEXP)
} = await shell.waitForOutput(URL_REGEXP)

// wait for server to be ready
await shell.waitForOutput(START_SERVER_REGEXP)
await measureTime('server startup', { props: { turbopack, page } })
await shell.reportMemUsage('mem usage after startup', {
props: { turbopack, page },
Expand Down Expand Up @@ -508,7 +514,7 @@ const nextDevWorkflow =
// wait for server to be ready
const {
groups: { url: url2 },
} = await shell.waitForOutput(START_SERVER_REGEXP)
} = await shell.waitForOutput(URL_REGEXP)
await shell.reportMemUsage('mem usage after startup with cache')

// open page
Expand Down
Loading