Skip to content

Commit ffb6131

Browse files
committed
test(integration): give the single-client runtime generous idle headroom
The sql-orm-client integration runtime now drives a single long-lived client so transactions hold one connection on the single-backend PGlite server. The dev server's default 1s idle timeout reaps that client during brief idle windows under full-suite load (a pool would reconnect; a lone client cannot), causing intermittent "connection terminated" flakes. Raise the idle timeout to 30s for these tests — no test holds the connection idle anywhere near that long. Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
1 parent 3a34f20 commit ffb6131

1 file changed

Lines changed: 17 additions & 9 deletions

File tree

test/integration/test/sql-orm-client/integration-helpers.ts

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,22 @@ export async function withCollectionRuntime(
5454
// plan's storageHash against the contract it was built with.
5555
contractOverride?: Contract<SqlStorage>,
5656
): Promise<void> {
57-
await withDevDatabase(async ({ connectionString }) => {
58-
const runtime = await createPgIntegrationRuntime(connectionString, contractOverride);
57+
await withDevDatabase(
58+
async ({ connectionString }) => {
59+
const runtime = await createPgIntegrationRuntime(connectionString, contractOverride);
5960

60-
try {
61-
await setupTestSchema(runtime);
62-
await fn(runtime);
63-
} finally {
64-
await runtime.close();
65-
}
66-
});
61+
try {
62+
await setupTestSchema(runtime);
63+
await fn(runtime);
64+
} finally {
65+
await runtime.close();
66+
}
67+
},
68+
// The runtime now drives a single long-lived client (so transactions hold one
69+
// connection on the single-backend PGlite server). The server's default 1s
70+
// idle timeout reaps that client during brief idle windows under full-suite
71+
// load — a pool would reconnect, a lone client cannot — so give it generous
72+
// headroom. No test holds the connection idle anywhere near this long.
73+
{ databaseIdleTimeoutMillis: 30_000 },
74+
);
6775
}

0 commit comments

Comments
 (0)