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 agent sockets on macOS 27

Alfredo Lopez3ff4f48b569a
diff --git a/control-api/package-lock.json b/control-api/package-lock.json
index efe682948..5866a0ac6 100644
--- a/control-api/package-lock.json
+++ b/control-api/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-api",
- "version": "0.1.637",
+ "version": "0.1.638",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-api",
- "version": "0.1.637",
+ "version": "0.1.638",
"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 52a7ddeb8..2783e9829 100644
--- a/control-api/package.json
+++ b/control-api/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-api",
- "version": "0.1.637",
+ "version": "0.1.638",
"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..65d56cd43 100644
--- a/control-api/test/routes.externalGfsRateLimitStress.realPostgres.integration.test.ts
+++ b/control-api/test/routes.externalGfsRateLimitStress.realPostgres.integration.test.ts
@@ -274,7 +274,13 @@ 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 })
+ // macOS 27 (Darwin 27.0) resets several hundred simultaneous loopback
+ // connects even against a bare node:http server (verified: 352 of 481
+ // ECONNRESET with an unbounded agent; 0 with this cap, which still drains
+ // the 481-request burst in ~72 ms). The scenarios' budget accounting does
+ // not depend on 481 open TCP sockets at once, only on the requests hitting
+ // the limiter as one burst, so bound the agent's sockets.
+ const agent = new http.Agent({ keepAlive: true, maxSockets: 100 })
if (openServer) throw new Error('a scenario server is already open')
openServer = {
close: () => {