Skip to content

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

TypeScript

test(control-api): bound stress-test sockets below the macOS accept queue

Alfredo Lopez723b2722294a
diff --git a/control-api/package-lock.json b/control-api/package-lock.json
index 8e97d3837..7ef3d48ad 100644
--- a/control-api/package-lock.json
+++ b/control-api/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-api",
- "version": "0.1.651",
+ "version": "0.1.652",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-api",
- "version": "0.1.651",
+ "version": "0.1.652",
"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 2cdde3af5..74a6b4932 100644
--- a/control-api/package.json
+++ b/control-api/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-api",
- "version": "0.1.651",
+ "version": "0.1.652",
"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 068d716ab..1a0213e85 100644
--- a/control-api/test/routes.externalGfsRateLimitStress.realPostgres.integration.test.ts
+++ b/control-api/test/routes.externalGfsRateLimitStress.realPostgres.integration.test.ts
@@ -274,7 +274,12 @@ describeRealPostgres('external GFS rate limits under concurrent load (real Postg
const server = http.createServer(app)
await new Promise<void>(resolve => server.listen(0, '127.0.0.1', resolve))
const { port } = server.address() as AddressInfo
- const agent = new http.Agent({ keepAlive: true })
+ // Bound the client sockets below the kernel accept queue. macOS caps the
+ // listen backlog at kern.ipc.somaxconn (128), so an unbounded agent opening
+ // 481 connections at once gets ECONNRESET before the app sees a request.
+ // 64 in flight still exceeds both production pools (core 10, limiter 6),
+ // so the limiter keeps contending on Postgres.
+ const agent = new http.Agent({ keepAlive: true, maxSockets: 64 })
if (openServer) throw new Error('a scenario server is already open')
openServer = {
close: () => {