From 7aba7b7e1d3746923250934cf2a061d26c22c289 Mon Sep 17 00:00:00 2001 From: shishantbiswas Date: Fri, 25 Sep 2026 09:19:21 +0000 Subject: [PATCH] testing action --- app/__test__/data/postgres.test.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/__test__/data/postgres.test.ts b/app/__test__/data/postgres.test.ts index 1560204d..cb04fda8 100644 --- a/app/__test__/data/postgres.test.ts +++ b/app/__test__/data/postgres.test.ts @@ -40,12 +40,17 @@ async function isPostgresRunning() { describe("postgres", () => { beforeAll(async () => { if (!(await isPostgresRunning())) { + // Only attempt to start container if port 5430 is not allocated by CI service + try { await $`docker run --rm --name bknd-test-postgres -d -e POSTGRES_PASSWORD=${credentials.password} -e POSTGRES_USER=${credentials.user} -e POSTGRES_DB=${credentials.database} -p ${credentials.port}:5432 postgres:17`; - await $waitUntil("Postgres is running", isPostgresRunning); - await new Promise((resolve) => setTimeout(resolve, 500)); + } catch (e) { + // Port allocated or docker unavailable; wait for CI service connection } + await $waitUntil("Postgres is running", isPostgresRunning); + await new Promise((resolve) => setTimeout(resolve, 500)); + } - disableConsoleLog(); + disableConsoleLog(); }); afterAll(async () => { if (await isPostgresRunning()) {