Skip to content

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

TypeScript

test(control-api): read the revoked row directly in the T-753h race test (#739)

Alfredo Lopez621143b647da
diff --git a/control-api/package-lock.json b/control-api/package-lock.json
index 4d0f51e90..35192d916 100644
--- a/control-api/package-lock.json
+++ b/control-api/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-api",
- "version": "0.1.621",
+ "version": "0.1.622",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-api",
- "version": "0.1.621",
+ "version": "0.1.622",
"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 f528c2ac0..45567e876 100644
--- a/control-api/package.json
+++ b/control-api/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-api",
- "version": "0.1.621",
+ "version": "0.1.622",
"description": "Internal Clerum control plane REST API + UI for managing CRDs and secrets",
"main": "dist/main.js",
"engines": {
diff --git a/control-api/test/services.codexSubscriptionRefreshRejected.realPostgres.integration.test.ts b/control-api/test/services.codexSubscriptionRefreshRejected.realPostgres.integration.test.ts
index bc6e641cf..ea884386a 100644
--- a/control-api/test/services.codexSubscriptionRefreshRejected.realPostgres.integration.test.ts
+++ b/control-api/test/services.codexSubscriptionRefreshRejected.realPostgres.integration.test.ts
@@ -403,7 +403,16 @@ describeRealPostgres('Codex refresh rejected by the vendor on real PostgreSQL (#
expect(markAttempts).toBe(1)
expect(failure).toBeInstanceOf(CodexSubscriptionOAuthError)
expect(failure).toMatchObject({ code: 'stale_revision', persistedConnectionStatus: false })
- expect(await statusOf(key)).not.toBe('reauth_required')
+ // Read the table directly: the safe reader filters revoked rows, so it
+ // returns undefined here whatever status the mark left behind.
+ const { rows } = await pool.query<{ status: string; revoked_at: Date | null }>(
+ `SELECT status, revoked_at FROM codex_subscription_connections WHERE connection_key = $1`,
+ [key]
+ )
+ expect(rows).toHaveLength(1)
+ // Witness: the revoke really landed, so the row is the one the race produced.
+ expect(rows[0]?.revoked_at).toBeInstanceOf(Date)
+ expect(rows[0]?.status).not.toBe('reauth_required')
})
it('T-753e a 503 from the token endpoint stays provider_unavailable and leaves the row connected', async () => {