Files
orca/cloud/apps/relay/src/database-transient-error.test.ts
T
Jinwoo Hong 3eec77c11a chore(cloud): add the relay fence broker, ops console, Terraform root, scripts, and 24 cloud-* workflows (#18413)
Phase 6 of the relay split: the relay's deploy/operate surface moves under cloud/ with 24 cloud-* workflows gated on ORCA_CLOUD_OPERATIONS_ENABLED, the Cloud SQL rollout lease action, the relay Terraform root (dual-accept identities for both repositories), scripts, docs, CODEOWNERS, and a terraform validate job in Cloud Verify.
2026-09-03 06:55:14 -04:00

19 lines
701 B
TypeScript

import { describe, expect, it } from 'vitest'
import { isRelayDatabaseTransientError } from './database.js'
describe('relay database transient errors', () => {
it.each(['40P01', '40001', '55P03', '57014', '53300', '57P03', '08001', '08006'])(
'classifies PostgreSQL code %s as retryable overload',
(code) => {
expect(isRelayDatabaseTransientError({ code })).toBe(true)
}
)
it('classifies pool acquisition timeout without hiding programming failures', () => {
expect(
isRelayDatabaseTransientError(new Error('timeout exceeded when trying to connect'))
).toBe(true)
expect(isRelayDatabaseTransientError(new TypeError('broken invariant'))).toBe(false)
})
})