Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timeout issue in RPC #28

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/utransport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ impl UPClientZenoh {
.query_map
.lock()
.unwrap()
.get(&reqid)
.remove(&reqid)
.ok_or_else(|| {
let msg = "query doesn't exist".to_string();
log::error!("{msg}");
Expand Down
6 changes: 3 additions & 3 deletions tests/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ impl UListener for ResponseListener {
panic!("The message should be Data::Value type.");
}
}
async fn on_error(&self, _err: UStatus) {
//panic!("Internal Error: {err:?}");
async fn on_error(&self, err: UStatus) {
panic!("Internal Error: {err:?}");
}
}

Expand Down Expand Up @@ -173,7 +173,7 @@ async fn test_rpc_server_client(dst_uuri: UUri, listen_uuri: UUri) {
upclient_client.send(umessage).await.unwrap();

// Waiting for the callback to process data
task::sleep(time::Duration::from_millis(5000)).await;
task::sleep(time::Duration::from_millis(2000)).await;

// Compare the result
assert_eq!(response_listener.get_response_data(), response_data);
Expand Down