Skip to content

test(core): dial port 1 where a test wants a refused connect - #4301

Merged
datlechin merged 1 commit into
mainfrom
fix/core-rand-and-test-ports
Nov 16, 2026
Merged

datlechin merged 1 commit into
mainfrom
fix/core-rand-and-test-ports

Conversation

@datlechin

@datlechin datlechin commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Tests that bound 127.0.0.1:0, dropped the listener and dialed the port now dial 127.0.0.1:1. Another test's bind(0) could take the freed port first (test(cassandra): hold the refused port in the relay's failed-open test #4298 on Windows). Port 1 is below every ephemeral range, so bind(0) never returns it, and a connect there is refused on Linux, macOS and Windows.
  • Holding a bound socket that never listens (test(cassandra): hold the refused port in the relay's failed-open test #4298) does not fit these tests: on macOS such a port drops the SYN, so the connect times out instead of being refused.
  • Covers tablepro-account (unreachable(), a_network_failure_never_words_the_share_token), tablepro-ffi and TablePro.Interop.Tests account tests, tablepro-ai, tablepro-cli, tablepro-net (dial, TLS probe), the ClickHouse editor run and the MongoDB replica set test.
  • Renames dropped_port_then_live_listener_connects_second to refused_port_then_live_listener_connects_second.
  • Dependabot alert 5 (RUSTSEC-2026-0097) needs no lock change: rand 0.8 is already 0.8.8. The alert matches rand 0.7.3, which only winauth 0.0.5 pulls (its latest release, rand ^0.7) through tiberius on Windows, and without rand's log feature, which the advisory requires.

Test plan

  • cargo test -p tablepro-account --lib looped 60 times on macOS: 60 passed.
  • Changed tests in tablepro-net, tablepro-ai, tablepro-driver-clickhouse and tablepro-cli pass on macOS.
  • Looped 40 times by dispatch, 40 of 40 passed on each: tablepro-account lib and AccountTests on Windows x64, Windows Arm64 and macOS; on Linux the account lib, tablepro-ffi account, net dial and TLS probe, ClickHouse editor run, AI providers and CLI tests. https://github.com/TableProApp/TablePro/actions/runs/43791277582

Needs the maintainer

  • Dismiss Dependabot alert 5 as "vulnerable code not actually used", or leave it until winauth moves past rand 0.7.
  • linux/crates/app/src/ui/preferences_dialog/account_page.rs (ready()) has the same pattern; left for after the Linux 0.1.0 soak.

@datlechin
datlechin merged commit 0e799eb into main Nov 16, 2026
35 checks passed
@datlechin
datlechin deleted the fix/core-rand-and-test-ports branch November 17, 2026 04:12
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