Skip to content

Commit

Permalink
await for requests from server without timing out
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaBatty committed Jul 25, 2023
1 parent 9604746 commit 99d274a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions sway-lsp/tests/utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,7 @@ pub async fn assert_server_requests(
) -> JoinHandle<()> {
tokio::spawn(async move {
let request_stream = socket.take(expected_requests.len()).collect::<Vec<_>>();
let requests =
tokio::time::timeout(timeout.unwrap_or(Duration::from_secs(10)), request_stream)
.await
.expect("Timed out waiting for requests from server");

let requests = request_stream.await;
assert_eq!(requests.len(), expected_requests.len());
for (actual, expected) in requests.iter().zip(expected_requests.iter()) {
assert_eq!(expected["method"], actual.method());
Expand Down

0 comments on commit 99d274a

Please sign in to comment.