Skip to content

ci: harden remaining integration tests against connection races#65

Merged
m1ngsama merged 1 commit into
mainfrom
ci/harden-integration-tests
Jun 30, 2026
Merged

ci: harden remaining integration tests against connection races#65
m1ngsama merged 1 commit into
mainfrom
ci/harden-integration-tests

Conversation

@m1ngsama

Copy link
Copy Markdown
Owner

Problem

Follow-up to #63. The integration suite intermittently goes red on loaded/macOS CI runners (seen on PR #62 and PR #64) because tests open many short-lived SSH connections in quick succession and transiently exceed the server's default per-IP concurrency cap (TNT_DEFAULT_MAX_CONN_PER_IP = 5). #63 fixed only test_exec_mode.sh; the same race affects the rest.

Fix

Apply the #63 hardening to the other integration tests that launch a server and connect over SSH:

  • test_basic.sh, test_module_runtime.sh, test_anonymous_access.sh, test_interactive_input.sh, test_mute_joins_view.sh, test_empty_view.sh

Each now:

  • launches the test server with TNT_MAX_CONN_PER_IP=256 TNT_MAX_CONNECTIONS=256 (root cause), and
  • passes -o ConnectionAttempts=3 -o ConnectTimeout=15 to its ssh options (SSH-layer resilience).

Intentionally unchanged

  • test_user_lifecycle.sh — already sets --max-conn-per-ip 32.
  • test_tntctl_cli.sh — uses a fake ssh in PATH (no real server).
  • test_connection_limits.sh — deliberately exercises the caps.

Also bumps the version in the docs/MODULE_PROTOCOL.md handshake example to 1.2.0.

Verification

No product code touched. make integration-test and make anonymous-access-test pass locally (exit 0). This should eliminate the recurring re-run-to-green need.

PR #63 fixed test_exec_mode.sh; apply the same hardening to the other
integration tests that launch a server and open SSH connections in quick
succession (test_basic, test_module_runtime, test_anonymous_access,
test_interactive_input, test_mute_joins_view, test_empty_view):

- launch the test server with TNT_MAX_CONN_PER_IP=256 TNT_MAX_CONNECTIONS=256
  so rapid localhost connections never transiently exceed the default per-IP
  cap (5) on slow CI runners (the macOS/loaded-ubuntu flake root cause), and
- add ssh ConnectionAttempts=3 / ConnectTimeout=15 so a dropped identification
  handshake is retried rather than failing an assertion.

test_user_lifecycle.sh already sets a high per-IP cap; test_tntctl_cli.sh uses
a fake ssh (no real server); test_connection_limits.sh intentionally exercises
the caps -- all left unchanged. Also bump the version in the MODULE_PROTOCOL.md
handshake example to 1.2.0. Verified: integration + anonymous-access suites
pass locally.
@m1ngsama m1ngsama merged commit 035ed25 into main Jun 30, 2026
5 checks passed
@m1ngsama m1ngsama deleted the ci/harden-integration-tests branch June 30, 2026 06:19
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