Skip to content

Commit 8e942af

Browse files
author
Кирилл Безуглый
committed
test: add error string assertion to connect_with_timeout
1 parent 407270b commit 8e942af

File tree

1 file changed

+9
-5
lines changed
  • tarantool/src/network/client

1 file changed

+9
-5
lines changed

tarantool/src/network/client/mod.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -491,14 +491,18 @@ mod tests {
491491
#[crate::test(tarantool = "crate")]
492492
async fn connect_with_timeout() {
493493
// Without timeout, the connection hangs on address like this
494-
Client::connect_with_config(
495-
"123123",
494+
let client = Client::connect_with_config(
495+
"123123", // Invalid host
496496
listen_port(),
497497
protocol::Config::default(),
498498
Some(Duration::from_secs(1)),
499-
)
500-
.await
501-
.unwrap_err();
499+
);
500+
let res = client.await.unwrap_err();
501+
if cfg!(target_os = "macos") {
502+
assert!(res.to_string().contains("No route to host"));
503+
} else {
504+
assert_eq!(res.to_string(), "connect timeout");
505+
}
502506
}
503507

504508
#[crate::test(tarantool = "crate")]

0 commit comments

Comments
 (0)