Skip to content

Commit 19bc016

Browse files
committed
chore: remove debug diagnostics after root cause identified and fixed
1 parent 24399e3 commit 19bc016

2 files changed

Lines changed: 0 additions & 29 deletions

File tree

apps/webapp/test/helpers/seedTestEnvironment.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,13 @@ export async function seedTestEnvironment(prisma: PrismaClient) {
1010
const apiKey = `tr_dev_${randomHex(24)}`;
1111
const pkApiKey = `pk_dev_${randomHex(24)}`;
1212

13-
const t0 = Date.now();
14-
process.stderr.write(`[seed] creating organization (${suffix})...\n`);
15-
1613
const organization = await prisma.organization.create({
1714
data: {
1815
title: `e2e-test-org-${suffix}`,
1916
slug: `e2e-org-${suffix}`,
2017
v3Enabled: true,
2118
},
2219
});
23-
process.stderr.write(`[seed] organization created in ${Date.now() - t0}ms\n`);
2420

2521
const project = await prisma.project.create({
2622
data: {
@@ -31,7 +27,6 @@ export async function seedTestEnvironment(prisma: PrismaClient) {
3127
engine: "V2",
3228
},
3329
});
34-
process.stderr.write(`[seed] project created in ${Date.now() - t0}ms\n`);
3530

3631
const environment = await prisma.runtimeEnvironment.create({
3732
data: {
@@ -44,7 +39,6 @@ export async function seedTestEnvironment(prisma: PrismaClient) {
4439
organizationId: organization.id,
4540
},
4641
});
47-
process.stderr.write(`[seed] environment created in ${Date.now() - t0}ms\n`);
4842

4943
return { organization, project, environment, apiKey };
5044
}

internal-packages/testcontainers/src/webapp.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ export async function startTestServer(): Promise<TestServer> {
160160
let prisma: PrismaClient | undefined;
161161
let stopWebapp: (() => Promise<void>) | undefined;
162162
let webapp: WebappInstance;
163-
let diagInterval: ReturnType<typeof setInterval> | undefined;
164163

165164
try {
166165
const pg = await createPostgresContainer(network);
@@ -171,27 +170,6 @@ export async function startTestServer(): Promise<TestServer> {
171170

172171
prisma = new PrismaClient({ datasources: { db: { url: pg.url } } });
173172
await prisma.$connect(); // pre-warm pool; surface connection failures before tests start
174-
175-
// Periodically dump pg_stat_activity when debugging to identify hangs.
176-
if (process.env.WEBAPP_TEST_VERBOSE) {
177-
diagInterval = setInterval(async () => {
178-
try {
179-
const rows = await prisma!.$queryRawUnsafe<Record<string, unknown>[]>(`
180-
SELECT pid, state, wait_event_type, wait_event,
181-
LEFT(query, 300) AS query,
182-
EXTRACT(EPOCH FROM (now() - state_change))::int AS state_age_secs,
183-
EXTRACT(EPOCH FROM (now() - query_start))::int AS query_age_secs
184-
FROM pg_stat_activity
185-
WHERE datname = current_database() AND pid != pg_backend_pid()
186-
ORDER BY query_start NULLS LAST
187-
`);
188-
process.stderr.write(`[pg_stat_activity] ${JSON.stringify(rows)}\n`);
189-
} catch {
190-
// Diagnostic failures are non-fatal; ignore them.
191-
}
192-
}, 10_000);
193-
}
194-
195173
const started = await startWebapp(pg.url, { host: rc.getHost(), port: rc.getPort() });
196174
webapp = started.instance;
197175
stopWebapp = started.stop;
@@ -205,7 +183,6 @@ export async function startTestServer(): Promise<TestServer> {
205183
}
206184

207185
const stop = async () => {
208-
if (diagInterval) clearInterval(diagInterval);
209186
await stopWebapp!().catch((err) => console.error("stopWebapp failed:", err));
210187
await prisma!.$disconnect().catch((err) => console.error("prisma.$disconnect failed:", err));
211188
await pgContainer!.stop().catch((err) => console.error("pgContainer.stop failed:", err));

0 commit comments

Comments
 (0)