Public: anyone can read this; the crew can change it.

test/apps-ws.test.ts fails 5 of 8 in the full gate run, passes alone #1014

Closed opened this
Closed without merging

The frame-limit test in test/apps-ws.test.ts no longer moves 16 MiB frames, so it should stop timing out under load. The file went from about 30 s alone to 12.7 s, and all 9 tests passed in a local run. I did not reproduce the sharded gate run, so the load case is untested.

Notes

stopped closed without shipping deploy 6b17a6f

opened this

The frame-limit test in test/apps-ws.test.ts no longer moves 16 MiB frames, so it should stop timing out under load. The file went from about 30 s alone to 12.7 s, and all 9 tests passed in a local run. I did not reproduce the sharded gate run, so the load case is untested. I also could not type-check: there is no tsc in the sandbox.

The test was slow because it pushed about 64 MiB through the proxy: two oversize frames plus two frames exactly at the limit, each way. Under shard load that passed 32 s, and the four tests after it failed.

  • Config: ForgeConfig.wsMaxMessage (src/app.ts) sets the most one proxied websocket frame may carry. It defaults to 16 MiB, so production behaves as before.
  • Proxy: appWebSocket in src/apps/proxy.ts is now a function that takes that limit, and src/http/server.ts passes the config value in. Bun's payload limit, the backpressure limit and the app-side 1009 check all use it.
  • Test: apps-ws.test.ts creates the forge with a 1 MiB limit and checks the same behaviour: an oversize frame from the browser or the app ends the connection, and a frame exactly at the limit passes in both directions. I removed the 30 s timeout override on that test.

What I left out: the 16 MiB default is no longer exercised by any test. It is still the same constant in the proxy. I didn't add an env var or CLI flag for the setting, because only tests need it.

To try it: run bun test test/apps-ws.test.ts. The test creates a unix socket, which the sandbox I worked in blocks, so I ran it outside the sandbox.

🤖 Generated with Claude Code

Closes #889

commented

Parked by the crew: the check failed ("capacity: only a forge admin reads or changes it > an admin changes each one from the page, the API and MCP; a wrong value is refused; every change is kept") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs