radicle-heartwood-lfs/crates
Adrian Duke bfb54bf4be e2e: Fix flakiness in `test_connection_crossing` test
Addresses intermittent failures in the `test_connection_crossing` e2e test,
which were particularly prevalent on slower CI environments (such as
`rust:trixie`).

Previously, the test spawned two threads to make Alice and Bob dial each
other concurrently and strictly asserted that the "preferred" peer (the
one with the higher Node ID) would always win the `Outbound` link direction.
However, this assumption is flawed in real-world, OS-level network execution
due to two race conditions:

1. Thread Scheduling: One thread could execute and fully establish a
   connection before the other thread even began processing its dial command.
2. Reactor Event Ordering: A node's reactor might wake up and process an
   incoming TCP connection from its peer *before* it processes the `Connect`
   command sent by the test. When it finally processes the `Connect` command,
   it sees a session already exists and skips dialing entirely.

In both scenarios, a true "simultaneous crossing" never occurs. Instead, a
standard sequential connection happens, meaning the link direction is dictated
by whoever dialed first, not by the "preferred" peer logic. This caused the
strict `left: Outbound, right: Inbound` assertions to panic.

To fix this, two changes were made:
- Introduced a `std::sync::Barrier` to synchronize the two test threads.
  This forces both threads to wait for each other before calling `.connect()`,
  maximizing the probability of a true simultaneous dial.
- Relaxed the final assertions. Because OS-level TCP handshakes and reactor
  polling can never guarantee perfect simultaneity, we no longer assert
  *which* peer gets the `Outbound` link. Instead, we assert the core invariant:
  that exactly one connection is established between the nodes, and that their
  link directions are opposite (`s1.link != s2.link`).
2026-04-23 08:39:03 +01:00
..
radicle cli/config: Obsolete `{get,set,push,remove,unset}` 2026-04-22 15:45:57 +01:00
radicle-cli cli/config: Obsolete `{get,set,push,remove,unset}` 2026-04-22 15:45:57 +01:00
radicle-cli-test clippy: Disallow lints `collapsible_*` 2026-04-15 10:06:05 +02:00
radicle-cob clippy: Deny `unwrap_used` 2026-04-15 10:06:05 +02:00
radicle-core Spell "Radicle" with a captial R 2026-04-17 17:15:31 +01:00
radicle-crypto cargo: Update `cyphernet` from 0.5.2 to 0.5.3 2026-04-15 11:59:15 +01:00
radicle-dag repo: Move workspace crates into `crates` subdirectory 2025-06-09 15:09:21 +02:00
radicle-fetch cargo: Remove unused dependencies 2026-04-15 01:50:14 +02:00
radicle-git-metadata rust/edition/fmt: 2021 → 2024 2026-03-30 16:57:51 +02:00
radicle-git-ref-format git-ref-format: New crate 2025-10-13 13:34:15 +02:00
radicle-localtime localtime: add description in Cargo.toml 2026-02-20 13:48:14 +00:00
radicle-node e2e: Fix flakiness in `test_connection_crossing` test 2026-04-23 08:39:03 +01:00
radicle-oid rust/edition/fmt: 2021 → 2024 2026-03-30 16:57:51 +02:00
radicle-protocol I2P Support 2026-04-15 12:01:50 +01:00
radicle-remote-helper Spell "Radicle" with a captial R 2026-04-17 17:15:31 +01:00
radicle-schemars schemars: Update to 0.7.0 2026-03-26 15:32:50 +00:00
radicle-signals rust/edition/fmt: 2021 → 2024 2026-03-30 16:57:51 +02:00
radicle-systemd rust/edition/fmt: 2021 → 2024 2026-03-30 16:57:51 +02:00
radicle-term Spell "Radicle" with a captial R 2026-04-17 17:15:31 +01:00
radicle-windows rust/edition/fmt: 2021 → 2024 2026-03-30 16:57:51 +02:00