mirror of
https://github.com/logos-messaging/logos-delivery-rust-bindings.git
synced 2026-07-29 22:43:34 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
parent
430ebc0bda
commit
6a107e66cc
@ -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(())
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user