Skip to content

Run authenticated Unix-socket reconnect tests in CI - #809

Merged
fcostaoliveira merged 3 commits into
masterfrom
codex/fix726-unix-ci-20261023
Oct 23, 2026
Merged

fcostaoliveira merged 3 commits into
masterfrom
codex/fix726-unix-ci-20261023

Conversation

@fcostaoliveira

@fcostaoliveira fcostaoliveira commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

The RLTest runner never selects Unix sockets, leaving reconnect timers and proxy tests on TCP in CI. Deep checkout or temporary paths can also exceed the Unix socket path limit.

Root cause

The wrapper has no Unix mode and no corresponding matrix cell. Existing reconnect helpers omit the runner password on some benchmark invocations and clear it after password-change tests, preventing an authenticated cell from exercising the full suite.

Fix

Add UNIX=1 for standalone, non-TLS tests. RLTest logs and temporary proxy sockets use a short, printed /tmp directory retained for failure artifacts. Reject incompatible TLS, cluster, replica or disabled-standalone combinations. Add a Unix reconnect CI cell using a dedicated port and dummy password, and upload its failure logs as a tar.gz so RLTest directory colons are retained.

Expose quoted REDIS_PORT and REDIS_PASSWORD runner arguments. Reconnect helpers propagate the runner password without overriding explicit AUTH scenarios, then restore the original password after password-change tests. Cleanup reconnects through an explicit ConnectionPool if the admin connection was lost; a permanent regression covers that case. Existing no-password restoration remains empty. Freeze proxy replies before the accept-then-close test drops connections, so the retry case always has held workload; retain its deadline/log assertions and require abandoned-replay and JSON evidence. No benchmark production code changes.

Tests

  • Runner contract: baseline UNIX=1 still emits TCP arguments; fixed emits --unix with short --log-dir and TMPDIR. Plain TCP stays unchanged. Four incompatible combinations fail before launching RLTest. An injected RLTest exit7 is preserved; a password containing spaces stays one argument.
  • Actual authenticated Unix disappeared-socket deadline test: 1/1 passes in6 seconds through the committed runner and an in-tree build, without a validation adapter.
  • Preceding head24b8d93: the full reconnect module completes in203 seconds, 27 PASS /5 intended SKIP /0 FAIL. Its26 Unix JSON reports prove socket paths up to69 bytes, including disappeared-socket synchronous reconnect failures, proxy recovery, deadline behavior and authentication scenarios. No validation adapter is used.
  • The new cleanup regression passes through actual RLTest; paired execution of the old helper raises TypeError, while the fixed helper restores the original password after an admin-pool disconnect. Four auth-argument controls preserve explicit AUTH and passwords with spaces.
  • Local execution uses the equivalent module spelling TEST=test_reconnections. The whole-file .py spelling is externally SIGKILLed during Python stdlib import, even with --collect-only; cause remains unproven and the cgroup OOM counter did not change. CI retains the ordinary .py spelling and its new Unix cell must pass on this head before merge.
  • Final c4e5943 follow-up: the new Unix CI cell exposed an idle-workload assumption in one existing retry test and an artifact-upload rejection of colon paths. Neither failure is waived. With replies held before closing, 3/3 authenticated Unix repeats pass (16s); that case plus admin cleanup pass 2/2 TCP (9s) and 2/2 TLS (10s). A tar archive round-trip preserves the colon-containing result paths. Current-head full CI remains required.
  • Fresh autotools/configure/build, bash syntax and whitespace checks pass. Seven independent reviews and exact-head CI/bot gates remain required.

Affected versions

The missing RLTest Unix CI coverage dates to c9278c0 (#114), first released in 1.3.0. The wrapper began at 84c837c, first in 1.4.0. The gap persists through 2.5.2 and master; this is source/tag attribution, not a claim every release has a Unix product defect. Current baseline is6818fe3. The separate test_unix_socket.py smoke does not run these RLTest reconnect branches.

Fixes #726.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

🤖 Automated first-pass review — a human maintainer's review is still required before merge.

Thanks for this. It only touches tests and CI (run_tests.sh, ci.yml, test_reconnections.py), with no benchmark code changes, and it mostly looks fine to me. Two small questions:

  • In test_accept_then_close_peer_with_retry_on_error_ends_at_test_time, where does the Connection Errors >= 4 lower bound come from? With 2 clients and the proxy closing every new connection from ~2s until the 4s deadline, I guess it holds easily. But the number isn't explained, and the test now also needs the "held for retry ... were not resent" line, which depends on the 1.0s freeze landing while pipelined replies are in flight. I may be wrong, but a short comment on why 4 is safe (or a looser > 0) would make a future flake easier to diagnose.
  • Just a quick check: that test change (the third commit) is about the replay path, not Unix-socket coverage. Was it needed to make the new Unix cell pass, or is it an unrelated tightening that came along? Either is fine, but it would help to say so in the description.

Nitpicking: in test_password_restored_after_admin_reconnect, the finally runs _restore_requirepass a second time even when the test passes. That's harmless since the first CONFIG SET just succeeds again, but a one-line comment would save the next reader from wondering.

The _restore_requirepass change also looks right to me. Using an explicit ConnectionPool plus pool.disconnect() avoids leaking connections from the retry clients, and the old _clear_requirepass would have left an authenticated cell without its password for every later test in the file. Once the new Unix cell is green on this head, I think this is fine to go in.

@fcostaoliveira

Copy link
Copy Markdown
Collaborator Author

The final head24b8d93 now completes the full reconnect module locally in203 seconds:27 PASS,5 intended transport/cluster skips,0 FAIL. The26 Unix JSON reports use socket paths no longer than69 bytes. This runs through the committed runner with a password-protected Redis and no auth adapter. The admin-pool reconnect regression also passes and fails against the previous cleanup helper.

The local SIGKILL is not yet attributed: it occurs during Python stdlib import even for --collect-only with the whole-file .py spelling, while the equivalent module spelling collects and runs all32 functions. The cgroup OOM counter did not change during a repeat. The PR body now states this limitation accurately. The new GitHub Unix cell remains a mandatory exact-head gate; it will not be waived on the strength of the local run.

Keeping the printed temporary directory after success is deliberate so local users can inspect successful reconnect traces and JSON reports as well as failed ones. The help explicitly documents retention; CI runners are ephemeral and only failure artifacts are uploaded. The dedicated port is an explicit, configurable test base so the CI recipe can also be used on developer machines without relying on the default Redis port; it is not a special GitHub networking requirement.

@fcostaoliveira

Copy link
Copy Markdown
Collaborator Author

The first new Unix CI run completed discovery and all32 tests, then exposed two issues now fixed in c4e5943. The accept-then-close test sometimes dropped an idle workload: it exited normally at its deadline without entering the asserted replay path. It now freezes replies before closing, retains its existing deadline/log assertions, and also checks abandoned replay work plus JSON count, connection errors and duration. It passes3/3 authenticated Unix repeats; with the cleanup regression, TCP and TLS each pass2/2.

The failure-log upload rejected colons in RLTest result paths. The job now packages the logs as tar.gz before upload; a round-trip archive check preserves those paths. These are real fixes, not waived failures. The updated head still needs the entire CI gate, including the new Unix cell.

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.

CI: run the RLTest suites over a unix socket (--unix)

1 participant