Skip to content

ci: harden exec-mode test against macOS connection races#63

Merged
m1ngsama merged 1 commit into
mainfrom
ci/harden-macos-exec-test
Jun 29, 2026
Merged

ci: harden exec-mode test against macOS connection races#63
m1ngsama merged 1 commit into
mainfrom
ci/harden-macos-exec-test

Conversation

@m1ngsama

Copy link
Copy Markdown
Owner

Problem

test_exec_mode.sh intermittently fails only on the macOS CI runner with ✗ users usage output unexpected (observed on PR #62). The same test passes on Ubuntu CI and locally on macOS.

Root cause

The suite opens many short-lived SSH exec connections in quick succession. On macOS the closed sockets linger (TIME_WAIT), so the server's default per-IP concurrency cap (TNT_DEFAULT_MAX_CONN_PER_IP = 5) is transiently exceeded and a connection is refused mid-suite → empty output → the usage grep fails. The test disabled the rate limit (TNT_RATE_LIMIT=0) but not the concurrency cap.

Fix

  • Launch the test server with high caps: TNT_MAX_CONN_PER_IP=256 TNT_MAX_CONNECTIONS=256 (well above the in-flight count this suite produces).
  • Add -o ConnectionAttempts=3 -o ConnectTimeout=15 to the test's SSH_OPTS so a dropped identification handshake is retried rather than failing the assertion.

No product code changes; test-only. Verified stable across repeated local macOS runs (25/25 each).

The exec suite opens many short-lived SSH connections in quick succession.
On macOS CI the closed sockets linger, so the default per-IP concurrency
cap (5) is transiently exceeded and a connection is refused mid-suite,
producing a flaky 'users usage output unexpected' failure (seen on PR #62;
the same test passes on Ubuntu and locally).

Raise the test server's per-IP/global connection caps well above the
in-flight count this suite can produce, and add ssh ConnectionAttempts/
ConnectTimeout so a dropped identification handshake is retried rather than
failing the assertion. Verified stable across repeated local macOS runs.
@m1ngsama m1ngsama merged commit f0ec00b into main Jun 29, 2026
5 checks passed
@m1ngsama m1ngsama deleted the ci/harden-macos-exec-test branch June 29, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant