Skip to content

test(jetsocat): replace flaky socks5_to_jmux proptest with deterministic CLI test#1718

Merged
Benoît Cortier (CBenoit) merged 6 commits intomasterfrom
test/replace-flaky-test
Mar 19, 2026
Merged

test(jetsocat): replace flaky socks5_to_jmux proptest with deterministic CLI test#1718
Benoît Cortier (CBenoit) merged 6 commits intomasterfrom
test/replace-flaky-test

Conversation

@CBenoit
Copy link
Member

@CBenoit Benoît Cortier (CBenoit) commented Mar 18, 2026

The proptest-based integration test was flaky on both Linux and Windows CI:

  • External network call to rust-lang.org:80 failed when the server returned an unexpected HTTP response (e.g. redirect without HTML body)
  • Same ports rebound 32 times per run risked TIME_WAIT races

Replace with two deterministic rstest cases (TCP and WebSocket) in the testsuite CLI suite. The new test spawns real jetsocat subprocesses and uses an in-process tokio echo server, with no external network dependency.

…tic CLI test

The proptest-based integration test was flaky on both Linux and Windows CI:
- External network call to rust-lang.org:80 failed when the server returned
  an unexpected HTTP response (e.g. redirect without HTML body)
- Same ports rebound 32 times per run risked TIME_WAIT races

Replace with two deterministic rstest cases (TCP and WebSocket) in the
testsuite CLI suite. The new test spawns real jetsocat subprocesses and
uses an in-process tokio echo server, with no external network dependency.
@CBenoit Benoît Cortier (CBenoit) changed the title test(jetsocat): replace flaky socks5_to_jmux proptest with determinis… test(jetsocat): replace flaky socks5_to_jmux proptest with deterministic CLI test Mar 18, 2026
@CBenoit Benoît Cortier (CBenoit) enabled auto-merge (squash) March 18, 2026 15:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the SOCKS5→JMUX end-to-end test coverage from the jetsocat crate’s (removed) proptest-based integration test into the workspace testsuite CLI test harness, and cleans up jetsocat’s test-only dependencies accordingly.

Changes:

  • Added a new testsuite async CLI test that validates SOCKS5 listener → JMUX tunnel → TCP echo server (TCP and WebSocket variants).
  • Added proxy-socks as a testsuite dev-dependency to drive a SOCKS5 client in the new test.
  • Removed the old jetsocat integration test and dropped jetsocat’s dev-dependencies previously used only by that test.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
testsuite/tests/cli/jetsocat.rs Adds new async SOCKS5→JMUX tunnel test using spawned jetsocat processes.
testsuite/Cargo.toml Adds proxy-socks dev-dependency for the new test.
jetsocat/tests/socks5-to-jmux.rs Removes old proptest-based integration test (now covered in testsuite).
jetsocat/src/lib.rs Removes test-only forced-link imports (no longer needed after deleting the integration test).
jetsocat/Cargo.toml Removes dev-dependencies tied to the deleted integration test.
Cargo.lock Updates lockfile to reflect dependency removals/additions.
Comments suppressed due to low confidence (1)

jetsocat/Cargo.toml:84

  • This PR removes proptest/test-utils from jetsocat's dev-dependencies, but jetsocat/src/main.rs still has #[cfg(test)] use {proptest as _, test_utils as _}; (line ~27). cargo test -p jetsocat will fail to compile unless that import is removed or the dev-dependencies are kept.
  "Win32_Security_Credentials",
  "Win32_Globalization",
]



💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces a flaky proptest-based socks5_to_jmux integration test in jetsocat with deterministic CLI-driven tests in the testsuite, eliminating external network dependency and reducing port-rebind/TIME_WAIT flakiness in CI.

Changes:

  • Added a deterministic socks5_to_jmux CLI integration test (parameterized for TCP vs WebSocket) that spawns real jetsocat subprocesses and uses an in-process Tokio TCP echo server.
  • Introduced a new wait_for_port_bound helper to detect single-accept listeners being ready without consuming their one connection slot.
  • Removed the old jetsocat proptest integration test and related jetsocat dev-dependencies/imports.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
testsuite/tests/cli/jetsocat.rs Adds deterministic SOCKS5→JMUX→echo round-trip test covering TCP and WS pipes via real subprocesses.
testsuite/src/cli.rs Adds wait_for_port_bound helper for readiness checks without connecting.
testsuite/Cargo.toml Adds proxy-socks as a dev-dependency for the new CLI test.
jetsocat/tests/socks5-to-jmux.rs Removes flaky proptest-based integration test that relied on external network and repeated port rebinds.
jetsocat/src/main.rs Removes test-only force-link imports tied to the removed proptest test/dev-deps.
jetsocat/src/lib.rs Removes test-only force-link imports tied to the removed proptest test/dev-deps.
jetsocat/Cargo.toml Removes now-unused dev-dependencies (proptest, test-utils, tokio) previously required only by the removed test.
Cargo.lock Updates dependency graph to reflect removed jetsocat dev-deps and added testsuite dev-dep.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@CBenoit Benoît Cortier (CBenoit) enabled auto-merge (squash) March 19, 2026 00:28
@CBenoit Benoît Cortier (CBenoit) merged commit c3c6b22 into master Mar 19, 2026
40 checks passed
@CBenoit Benoît Cortier (CBenoit) deleted the test/replace-flaky-test branch March 19, 2026 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants