From aa4a08889b603a30e74dc5f962f680ae70056b78 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Wed, 19 Nov 2025 17:49:47 +1100 Subject: [PATCH] test(connlib): set TCP connections as connected after roaming (#10910) TCP connections have a keep-alive mechanism and therefore will automatically trigger a new connection to a resource after roaming. We need to model this in our tests by setting the resource as connected whenever we reset the network state. --- rust/connlib/tunnel/proptest-regressions/tests.txt | 1 + rust/connlib/tunnel/src/tests/sim_client.rs | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/rust/connlib/tunnel/proptest-regressions/tests.txt b/rust/connlib/tunnel/proptest-regressions/tests.txt index 9ef0db5ff..1f5dd4332 100644 --- a/rust/connlib/tunnel/proptest-regressions/tests.txt +++ b/rust/connlib/tunnel/proptest-regressions/tests.txt @@ -243,3 +243,4 @@ cc 19b20eeea8590ac247e6534e42344cc4ae67a5d8e964f04e81b56f344d257c7b cc 46d17b15ff020c3f4982c43d85a342c5d10f5cec34a2316282ecfbe3a684573d cc a2746c27c8acc2f163989297aba492f9c767d7d4b72fef1cb9b84b65e5cbdfea cc cb2df5e990c2f5c60f41f3b4dfe82736369a99dae8824bcc592831b3f366bc14 +cc c2226109d6e9a7566da7c5bcb4e9f3ca0bfd2b1b17a9f6e5db6515b3f0b1945e diff --git a/rust/connlib/tunnel/src/tests/sim_client.rs b/rust/connlib/tunnel/src/tests/sim_client.rs index 38df0b937..49fb41a75 100644 --- a/rust/connlib/tunnel/src/tests/sim_client.rs +++ b/rust/connlib/tunnel/src/tests/sim_client.rs @@ -648,12 +648,13 @@ impl RefClient { } // TCP connections will automatically re-create connections to Gateways. - for r in self + for ((_, dst, _, _), r) in self .expected_tcp_connections - .values() - .copied() + .clone() + .into_iter() .collect::>() { + self.connect_to_resource(r, dst); self.set_resource_online(r); } }