ci: harden exec-mode test against macOS connection races#63
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
test_exec_mode.shintermittently 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 usagegrepfails. The test disabled the rate limit (TNT_RATE_LIMIT=0) but not the concurrency cap.Fix
TNT_MAX_CONN_PER_IP=256 TNT_MAX_CONNECTIONS=256(well above the in-flight count this suite produces).-o ConnectionAttempts=3 -o ConnectTimeout=15to the test'sSSH_OPTSso 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).