From a803a54b023355a2bf8fcf69280383e3d15dea99 Mon Sep 17 00:00:00 2001 From: Gabi Date: Tue, 22 Oct 2024 21:05:28 -0300 Subject: [PATCH] fix(proptest): don't use port 53 for non-dns packets (#7129) For simplicity sake I assumed that any packet using port 53 would be a dns packet, but I forgot to exclude it from the range of possible ports used. This can cause spurious CI failures --- rust/connlib/tunnel/src/tests/transition.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/rust/connlib/tunnel/src/tests/transition.rs b/rust/connlib/tunnel/src/tests/transition.rs index ab47fde28..3d6742118 100644 --- a/rust/connlib/tunnel/src/tests/transition.rs +++ b/rust/connlib/tunnel/src/tests/transition.rs @@ -222,7 +222,7 @@ where src.prop_map(Into::into), dst.prop_map(Into::into), any::(), - any::(), + non_dns_ports(), any::(), any::(), ) @@ -250,7 +250,7 @@ where src.prop_map(Into::into), dst.prop_map(Into::into), any::(), - any::(), + non_dns_ports(), any::(), any::(), ) @@ -265,6 +265,13 @@ where }) } +fn non_dns_ports() -> impl Strategy { + any::().prop_filter( + "avoid using port 53 for non-dns queries for simplicity", + |p| *p != 53, + ) +} + /// Samples up to 5 DNS queries that will be sent concurrently into connlib. pub(crate) fn dns_queries( domain: impl Strategy,