Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

test(control-api): drop the fallback admin DSN from the rate-limit real-PG suites

Alfredo Lopezfa5870ba289c
diff --git a/control-api/package-lock.json b/control-api/package-lock.json
index 0056e37ad..211f524b5 100644
--- a/control-api/package-lock.json
+++ b/control-api/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-api",
- "version": "0.1.603",
+ "version": "0.1.604",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-api",
- "version": "0.1.603",
+ "version": "0.1.604",
"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.json
index 4bcfb5ef1..64d00e152 100644
--- a/control-api/package.json
+++ b/control-api/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-api",
- "version": "0.1.603",
+ "version": "0.1.604",
"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.externalGfsRateLimitStress.realPostgres.integration.test.ts b/control-api/test/routes.externalGfsRateLimitStress.realPostgres.integration.test.ts
index 41f45a283..7a33930c4 100644
--- a/control-api/test/routes.externalGfsRateLimitStress.realPostgres.integration.test.ts
+++ b/control-api/test/routes.externalGfsRateLimitStress.realPostgres.integration.test.ts
@@ -70,10 +70,6 @@ const describeRealPostgres = adminUrl ? describe : describe.skip
describeRealPostgres('external GFS rate limits under concurrent load (real PostgreSQL)', () => {
const database = `control_api_gfs_rl_stress_${randomBytes(6).toString('hex')}`
- const connectionString = databaseUrl(
- adminUrl ?? 'postgresql://[email protected]/postgres',
- database
- )
const envKeys = ['CONTROL_API_PG_CONNECTION_STRING', 'CORE_POOL_CONNECTION_TIMEOUT_MS'] as const
const previousEnv = new Map<string, string | undefined>()
@@ -92,6 +88,10 @@ describeRealPostgres('external GFS rate limits under concurrent load (real Postg
let nextScenarioMinuteMs = 0
beforeAll(async () => {
+ if (adminUrl === undefined) {
+ throw new Error('CONTROL_API_REAL_PG_ADMIN_URL is required by this suite')
+ }
+ const connectionString = databaseUrl(adminUrl, database)
for (const key of envKeys) previousEnv.set(key, process.env[key])
adminPool = new Pool({ connectionString: adminUrl })
await adminPool.query(`CREATE DATABASE ${quoteIdent(database)}`)
diff --git a/control-api/test/services.rateLimiterPoolSaturation.realPostgres.integration.test.ts b/control-api/test/services.rateLimiterPoolSaturation.realPostgres.integration.test.ts
index 7496fd582..144305483 100644
--- a/control-api/test/services.rateLimiterPoolSaturation.realPostgres.integration.test.ts
+++ b/control-api/test/services.rateLimiterPoolSaturation.realPostgres.integration.test.ts
@@ -47,10 +47,6 @@ const describeRealPostgres = adminUrl ? describe : describe.skip
describeRealPostgres('rate limiter under core pool saturation (known fail-open)', () => {
const database = `rate_limiter_saturation_${randomBytes(6).toString('hex')}`
- const connectionString = databaseUrl(
- adminUrl ?? 'postgresql://[email protected]/postgres',
- database
- )
const poolEnvKeys = [
'CONTROL_API_PG_CONNECTION_STRING',
'CORE_POOL_MAX',
@@ -78,6 +74,10 @@ describeRealPostgres('rate limiter under core pool saturation (known fail-open)'
}
beforeAll(async () => {
+ if (adminUrl === undefined) {
+ throw new Error('CONTROL_API_REAL_PG_ADMIN_URL is required by this suite')
+ }
+ const connectionString = databaseUrl(adminUrl, database)
for (const key of poolEnvKeys) previousEnv.set(key, process.env[key])
delete process.env.CORE_POOL_MAX
delete process.env.CORE_POOL_CONNECTION_TIMEOUT_MS