Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
test(control-api): let rate-limit real-PG teardowns fail loud
Alfredo Lopez0911334b0727
diff --git a/control-api/package-lock.json b/control-api/package-lock.jsonindex 641cde629..c57d40107 100644--- a/control-api/package-lock.json+++ b/control-api/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-api",- "version": "0.1.691",+ "version": "0.1.692","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-api",- "version": "0.1.691",+ "version": "0.1.692","dependencies": {"@clerum/display-field": "file:../packages/display-field","@clerum/grok-provider-attempt-contract": "file:../packages/grok-provider-attempt-contract",diff --git a/control-api/package.json b/control-api/package.jsonindex 392a3831e..8acf89846 100644--- a/control-api/package.json+++ b/control-api/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-api",- "version": "0.1.691",+ "version": "0.1.692","description": "Internal Clerum control plane REST API + UI for managing CRDs and secrets","main": "dist/main.js","engines": {diff --git a/control-api/test/routes.externalGfsRateLimitFailClosed.realPostgres.integration.test.ts b/control-api/test/routes.externalGfsRateLimitFailClosed.realPostgres.integration.test.tsindex b4e6c9bcd..ede8848c8 100644--- a/control-api/test/routes.externalGfsRateLimitFailClosed.realPostgres.integration.test.ts+++ b/control-api/test/routes.externalGfsRateLimitFailClosed.realPostgres.integration.test.ts@@ -119,8 +119,8 @@ describeRealPostgres('external GFS rate limiter backend (real PostgreSQL)', () =if (value === undefined) delete process.env[key]else process.env[key] = value}- await endPoolAndWaitForClients(corePool).catch(() => {})- await endPoolAndWaitForClients(limiterPool).catch(() => {})+ await endPoolAndWaitForClients(corePool)+ await endPoolAndWaitForClients(limiterPool)if (!adminPool) returnawait adminPool.query(`SELECT pg_terminate_backend(pid) FROM pg_stat_activitydiff --git a/control-api/test/routes.externalGfsRateLimitStress.realPostgres.integration.test.ts b/control-api/test/routes.externalGfsRateLimitStress.realPostgres.integration.test.tsindex 79a59d167..91940b34b 100644--- a/control-api/test/routes.externalGfsRateLimitStress.realPostgres.integration.test.ts+++ b/control-api/test/routes.externalGfsRateLimitStress.realPostgres.integration.test.ts@@ -227,8 +227,8 @@ describeRealPostgres('external GFS rate limits under concurrent load (real Postgif (value === undefined) delete process.env[key]else process.env[key] = value}- await endPoolAndWaitForClients(corePool).catch(() => {})- await endPoolAndWaitForClients(limiterPool).catch(() => {})+ await endPoolAndWaitForClients(corePool)+ await endPoolAndWaitForClients(limiterPool)if (!adminPool) returnawait adminPool.query(`SELECT pg_terminate_backend(pid) FROM pg_stat_activitydiff --git a/control-api/test/routes.llmModelGrantRace.realPostgres.integration.test.ts b/control-api/test/routes.llmModelGrantRace.realPostgres.integration.test.tsindex 0a319eb20..cc238bd4f 100644--- a/control-api/test/routes.llmModelGrantRace.realPostgres.integration.test.ts+++ b/control-api/test/routes.llmModelGrantRace.realPostgres.integration.test.ts@@ -169,9 +169,9 @@ describeRealPostgres('llm-model reductor ↔ grant upsert serialization (R1-H3 fafterAll(async () => {if (previousPgEnv === undefined) delete process.env.CONTROL_API_PG_CONNECTION_STRINGelse process.env.CONTROL_API_PG_CONNECTION_STRING = previousPgEnv- await endPoolAndWaitForClients(racePool).catch(() => {})- await endPoolAndWaitForClients(corePool).catch(() => {})- await endPoolAndWaitForClients(limiterPool).catch(() => {})+ await endPoolAndWaitForClients(racePool)+ await endPoolAndWaitForClients(corePool)+ await endPoolAndWaitForClients(limiterPool)if (!adminPool) returnawait adminPool.query(`SELECT pg_terminate_backend(pid) FROM pg_stat_activitydiff --git a/control-api/test/routes.llmModelHostRace.realPostgres.integration.test.ts b/control-api/test/routes.llmModelHostRace.realPostgres.integration.test.tsindex 8e7df1231..5ebaeb046 100644--- a/control-api/test/routes.llmModelHostRace.realPostgres.integration.test.ts+++ b/control-api/test/routes.llmModelHostRace.realPostgres.integration.test.ts@@ -174,8 +174,8 @@ describeRealPostgres('llm-model reductor ↔ host referencer serialization (R1-Hif (previousPgEnv === undefined) delete process.env.CONTROL_API_PG_CONNECTION_STRINGelse process.env.CONTROL_API_PG_CONNECTION_STRING = previousPgEnv// Drain the module pool's connections first so DROP DATABASE has no live users.- await endPoolAndWaitForClients(corePool).catch(() => {})- await endPoolAndWaitForClients(limiterPool).catch(() => {})+ await endPoolAndWaitForClients(corePool)+ await endPoolAndWaitForClients(limiterPool)if (!adminPool) returnawait adminPool.query(`SELECT pg_terminate_backend(pid) FROM pg_stat_activitydiff --git a/control-api/test/routes.rateLimitProcessMemory.realPostgres.integration.test.ts b/control-api/test/routes.rateLimitProcessMemory.realPostgres.integration.test.tsindex 6041980ae..1e5b2d32d 100644--- a/control-api/test/routes.rateLimitProcessMemory.realPostgres.integration.test.ts+++ b/control-api/test/routes.rateLimitProcessMemory.realPostgres.integration.test.ts@@ -116,8 +116,8 @@ describeRealPostgres('rateLimitMiddleware process-memory mode (real PostgreSQL)'if (value === undefined) delete process.env[key]else process.env[key] = value}- await endPoolAndWaitForClients(corePool).catch(() => {})- await endPoolAndWaitForClients(limiterPool).catch(() => {})+ await endPoolAndWaitForClients(corePool)+ await endPoolAndWaitForClients(limiterPool)if (!adminPool) returnawait adminPool.query(`SELECT pg_terminate_backend(pid) FROM pg_stat_activitydiff --git a/control-api/test/services.rateLimiterPoolSaturation.realPostgres.integration.test.ts b/control-api/test/services.rateLimiterPoolSaturation.realPostgres.integration.test.tsindex 4ce70fc79..53501d0c3 100644--- a/control-api/test/services.rateLimiterPoolSaturation.realPostgres.integration.test.ts+++ b/control-api/test/services.rateLimiterPoolSaturation.realPostgres.integration.test.ts@@ -139,8 +139,8 @@ describeRealPostgres('rate limiter under pool saturation', () => {if (value === undefined) delete process.env[key]else process.env[key] = value}- await endPoolAndWaitForClients(corePool).catch(() => {})- await endPoolAndWaitForClients(limiterPool).catch(() => {})+ await endPoolAndWaitForClients(corePool)+ await endPoolAndWaitForClients(limiterPool)if (!adminPool) returnawait adminPool.query(`SELECT pg_terminate_backend(pid) FROM pg_stat_activity