From c5fa4aff2a5bc091bd62fd7053376c79f6bf588a Mon Sep 17 00:00:00 2001 From: LongYinan Date: Wed, 14 Oct 2026 23:56:40 +0800 Subject: [PATCH] test(void): give the db request pool PGlite setup a Windows hook budget The PostgreSQL setup in db-request-pool.test.ts starts PGlite inside beforeAll with the default 10s hook timeout. A cold PGlite WASM start can take longer than that on Windows CI, so the hook timed out. Wait for PGlite inside the hook and give it 30s on Windows, as runner-pg.test.ts and db-export-roundtrip.test.ts already do. Query and test deadlines stay unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH --- .../void/test/unit/db-request-pool.test.ts | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/packages/void/test/unit/db-request-pool.test.ts b/packages/void/test/unit/db-request-pool.test.ts index 0567622ea..1fe95b996 100644 --- a/packages/void/test/unit/db-request-pool.test.ts +++ b/packages/void/test/unit/db-request-pool.test.ts @@ -130,20 +130,26 @@ describe.each(['postgresql', 'mysql'] as const)('void/db %s across requests', (d let pgServer: ReturnType | undefined; let mysqlServer: FakeMySqlServer | undefined; - beforeAll(async () => { - if (dialect === 'postgresql') { - pglite = new PGlite(); - await pglite.exec('CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT NOT NULL);'); - await pglite.exec("INSERT INTO users VALUES (1, 'Ada'), (2, 'Linus');"); - pgServer = createServer(pglite); - pgServer.listen(0, '127.0.0.1'); - await once(pgServer, 'listening'); - url = `postgresql://postgres@127.0.0.1:${(pgServer.address() as AddressInfo).port}/postgres`; - } else { - mysqlServer = await startFakeMySqlServer(USERS); - url = `mysql://void@127.0.0.1:${mysqlServer.port}/app`; - } - }); + beforeAll( + async () => { + if (dialect === 'postgresql') { + pglite = new PGlite(); + // Cold WASM startup can exceed 10s on Windows CI. Pay that cost in this hook, + // with its own budget; query and test deadlines stay unchanged. + await pglite.waitReady; + await pglite.exec('CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT NOT NULL);'); + await pglite.exec("INSERT INTO users VALUES (1, 'Ada'), (2, 'Linus');"); + pgServer = createServer(pglite); + pgServer.listen(0, '127.0.0.1'); + await once(pgServer, 'listening'); + url = `postgresql://postgres@127.0.0.1:${(pgServer.address() as AddressInfo).port}/postgres`; + } else { + mysqlServer = await startFakeMySqlServer(USERS); + url = `mysql://void@127.0.0.1:${mysqlServer.port}/app`; + } + }, + process.platform === 'win32' ? 30_000 : undefined, + ); afterAll(async () => { if (pgServer) {