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

GitOrigin-RevId: e8a565ae00019de66cbbaf961e0ee3ace90f800e
This commit is contained in:
Andrew Rumble
2025-04-17 08:06:11 +00:00
committed by Copybot
parent a6b8e8b8a7
commit 8b47b3d0a4
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -90,15 +90,16 @@ process.on('SIGINT', () => {
/** /**
* @param {number} port * @param {number} port
* @param {boolean} enableVerificationLoop
* @return {Promise<http.Server>} * @return {Promise<http.Server>}
*/ */
export async function startApp(port) { export async function startApp(port, enableVerificationLoop = true) {
await mongodb.client.connect() await mongodb.client.connect()
await loadGlobalBlobs() await loadGlobalBlobs()
await healthCheck() await healthCheck()
const server = http.createServer(app) const server = http.createServer(app)
await promisify(server.listen.bind(server, port))() await promisify(server.listen.bind(server, port))()
loopRandomProjects(shutdownEmitter) enableVerificationLoop && loopRandomProjects(shutdownEmitter)
return server return server
} }
@@ -26,7 +26,7 @@ async function listenOnRandomPort() {
return return
} catch {} } catch {}
} }
server = await startApp(0) server = await startApp(0, false)
} }
after('close server', function (done) { after('close server', function (done) {