From 6a107e66cc4877113a57e1fb09b24430334018ee Mon Sep 17 00:00:00 2001 From: Ivan FB Date: Thu, 16 Jul 2026 01:09:34 +0200 Subject: [PATCH] fix(test): let the echo's Result decide default_echo The select arm discarded test_echo_messages' Result, so the test passed whenever that future finished -- including the path where the message never arrived and it returned Err. Only the 1000s timeout could fail it, which made the assertion close to vacuous for the case it exists to cover. Co-Authored-By: Claude Opus 4.8 --- waku-bindings/tests/node.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/waku-bindings/tests/node.rs b/waku-bindings/tests/node.rs index 3971a19..6d0421d 100644 --- a/waku-bindings/tests/node.rs +++ b/waku-bindings/tests/node.rs @@ -127,12 +127,14 @@ async fn default_echo() -> Result<(), String> { tokio::pin!(sleep); // Send and receive messages. Waits until all messages received. + // The echo's Result decides the outcome: completing is not the same as + // having received the message. let got_all = tokio::select! { - _ = sleep => false, - _ = test_echo_messages(node1, node2, ECHO_MESSAGE, content_topic) => true, + _ = sleep => Err("timed out waiting for the echo".to_string()), + result = test_echo_messages(node1, node2, ECHO_MESSAGE, content_topic) => result, }; - assert!(got_all); + got_all?; Ok(()) }