Skip to content

Commit

Permalink
Improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
tbraun96 committed Apr 10, 2024
1 parent bddcc27 commit e4c935f
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions citadel_sdk/src/prefabs/client/single_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,6 @@ mod tests {
assert!(server_success.load(Ordering::Relaxed));
}

#[cfg(feature = "multi-threaded")]
#[rstest]
#[case(false, UdpMode::Enabled, Some("test-password"))]
#[timeout(std::time::Duration::from_secs(90))]
Expand Down Expand Up @@ -494,16 +493,20 @@ mod tests {
)
.unwrap();

// Spawn the server, since the server won't quit when a bad connection is made;
let _server = tokio::spawn(server);

let client = NodeBuilder::default().build(client_kernel).unwrap();

let result = client.await;
if let Err(error) = result {
assert!(error.into_string().contains("EncryptionFailure"));
} else {
panic!("Client should not have connected")
tokio::select! {
_res0 = server => {
panic!("Server should never finish")
},

result = client => {
if let Err(error) = result {
assert!(error.into_string().contains("EncryptionFailure"));
} else {
panic!("Client should not have connected")
}
}
}
}

Expand Down

0 comments on commit e4c935f

Please sign in to comment.