Don't run the verifier loop when app created from test

GitOrigin-RevId: e8a565ae00019de66cbbaf961e0ee3ace90f800e
This commit is contained in:
Andrew Rumble
2025-04-16 14:16:52 +01:00
committed by Copybot
parent a6b8e8b8a7
commit 8b47b3d0a4
2 changed files with 4 additions and 3 deletions

View File

@@ -90,15 +90,16 @@ process.on('SIGINT', () => {
/**
* @param {number} port
* @param {boolean} enableVerificationLoop
* @return {Promise<http.Server>}
*/
export async function startApp(port) {
export async function startApp(port, enableVerificationLoop = true) {
await mongodb.client.connect()
await loadGlobalBlobs()
await healthCheck()
const server = http.createServer(app)
await promisify(server.listen.bind(server, port))()
loopRandomProjects(shutdownEmitter)
enableVerificationLoop && loopRandomProjects(shutdownEmitter)
return server
}

View File

@@ -26,7 +26,7 @@ async function listenOnRandomPort() {
return
} catch {}
}
server = await startApp(0)
server = await startApp(0, false)
}
after('close server', function (done) {