jcp-gateway: the stdio tests' awk server answers on any awk #234

Merged
dcharlot merged 1 commit from fix/gateway-test-server-any-awk into main 2026-10-13 09:31:15 -04:00
Owner

Why

jcp-gateway's tests/stdio_binary.rs drives the real gateway binary in front of an awk MCP server. The tests passed in CI's Linux image and on macOS.

On a host whose awk is mawk, the default on Debian and Ubuntu, both tests failed at their 120 s deadline. mawk buffers piped input in blocks, so the server never saw the initialize request until the pipe closed, and the gateway, correctly, waited for its reply. This was found running the jcp-rs leg directly on jetson-hub's host, where /usr/bin/awk is mawk 1.3.4.

What

A test-only change. A small awk_server(script) asks the awk what it is (awk -W version):

  • mawk runs with -W interactive, which reads the pipe a line at a time;
  • other awks read lines as they come and reject or ignore that option, so they are left as they are.

Both tests build their server command through it.

Evidence

Host awk Before After
jetson-hub host mawk 1.3.4 2 failed at 120 s 2 passed in 1.85 s
M3 Ultra macOS awk 2 passed 2 passed in 1.56 s
CI Linux image the image's awk passed unchanged

🤖 Generated with Claude Code

## Why `jcp-gateway`'s `tests/stdio_binary.rs` drives the real gateway binary in front of an awk MCP server. The tests passed in CI's Linux image and on macOS. On a host whose awk is **mawk**, the default on Debian and Ubuntu, both tests failed at their 120 s deadline. mawk buffers piped input in blocks, so the server never saw the `initialize` request until the pipe closed, and the gateway, correctly, waited for its reply. This was found running the jcp-rs leg directly on jetson-hub's host, where `/usr/bin/awk` is mawk 1.3.4. ## What A test-only change. A small `awk_server(script)` asks the awk what it is (`awk -W version`): - **mawk** runs with `-W interactive`, which reads the pipe a line at a time; - **other awks** read lines as they come and reject or ignore that option, so they are left as they are. Both tests build their server command through it. ## Evidence | Host | awk | Before | After | |---|---|---|---| | jetson-hub host | mawk 1.3.4 | 2 failed at 120 s | 2 passed in 1.85 s | | M3 Ultra | macOS awk | 2 passed | 2 passed in 1.56 s | | CI Linux image | the image's awk | passed | unchanged | 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jcp-gateway: the stdio tests' awk server answers on any awk
All checks were successful
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 1m2s
standards workspaces build + test / jouleclaw-rs (pull_request) Successful in 2m58s
standards workspaces build + test / joule-code-rs (pull_request) Successful in 1m28s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 1m0s
standards workspaces build + test / aac-rs (pull_request) Successful in 2m33s
standards workspaces build + test / mesh-rs (pull_request) Successful in 58s
standards workspaces build + test / map-rs (pull_request) Successful in 1m0s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 4m28s
standards workspaces build + test / openpay (pull_request) Successful in 3m24s
lockfiles / every Cargo.lock is current (pull_request) Successful in 37s
standards workspaces build + test / arl-rs (pull_request) Successful in 1m15s
standards workspaces build + test / eoc-rs (pull_request) Successful in 2m3s
standards workspaces build + test / jcp-rs (pull_request) Successful in 1m30s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 1m13s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 1m10s
standards workspaces build + test / proof-rs (pull_request) Successful in 1m15s
standards workspaces build + test / sense-rs (pull_request) Successful in 1m9s
standards workspaces build + test / sandbox-rs (pull_request) Successful in 2m23s
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 4m1s
4e9aa8b58b
The two tests that drive the gateway binary in front of an awk server
passed in CI's Linux image and on macOS, but on a host whose awk is mawk
(Debian's and Ubuntu's default) both failed at their 120 s deadline: mawk
buffers piped input in blocks, so the server never saw the initialize
request until the pipe closed, and the gateway, correctly, waited for its
reply. The test asks the awk what it is and runs mawk with `-W
interactive`, which reads the pipe a line at a time; other awks, which
reject or ignore that option, are left as they are.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Transaction-Science/open-standards!234
No description provided.