Skip to content
Snippets Groups Projects
Commit e9e69165 authored by Niklas Adolfsson's avatar Niklas Adolfsson Committed by GitHub
Browse files

remove flaky rpc subscription tests (#11653)

parent dbe18817
No related merge requests found
......@@ -241,34 +241,6 @@ mod tests {
);
}
#[tokio::test]
async fn subscribe_and_unsubscribe_to_justifications() {
let (rpc, _) = setup_io_handler();
// Subscribe call.
let sub = rpc
.subscribe("beefy_subscribeJustifications", EmptyParams::new())
.await
.unwrap();
let ser_id = serde_json::to_string(sub.subscription_id()).unwrap();
// Unsubscribe
let unsub_req = format!(
"{{\"jsonrpc\":\"2.0\",\"method\":\"beefy_unsubscribeJustifications\",\"params\":[{}],\"id\":1}}",
ser_id
);
let (response, _) = rpc.raw_json_request(&unsub_req).await.unwrap();
assert_eq!(response, r#"{"jsonrpc":"2.0","result":true,"id":1}"#);
// Unsubscribe again and fail
let (response, _) = rpc.raw_json_request(&unsub_req).await.unwrap();
let expected = r#"{"jsonrpc":"2.0","result":false,"id":1}"#;
assert_eq!(response, expected);
}
#[tokio::test]
async fn subscribe_and_unsubscribe_with_wrong_id() {
let (rpc, _) = setup_io_handler();
......
......@@ -310,33 +310,6 @@ mod tests {
assert_eq!(expected_response, result);
}
#[tokio::test]
async fn subscribe_and_unsubscribe_to_justifications() {
let (rpc, _) = setup_io_handler(TestVoterState);
// Subscribe call.
let sub = rpc
.subscribe("grandpa_subscribeJustifications", EmptyParams::new())
.await
.unwrap();
let ser_id = serde_json::to_string(sub.subscription_id()).unwrap();
// Unsubscribe
let unsub_req = format!(
"{{\"jsonrpc\":\"2.0\",\"method\":\"grandpa_unsubscribeJustifications\",\"params\":[{}],\"id\":1}}",
ser_id
);
let (response, _) = rpc.raw_json_request(&unsub_req).await.unwrap();
assert_eq!(response, r#"{"jsonrpc":"2.0","result":true,"id":1}"#);
// Unsubscribe again and fail
let (response, _) = rpc.raw_json_request(&unsub_req).await.unwrap();
let expected = r#"{"jsonrpc":"2.0","result":false,"id":1}"#;
assert_eq!(response, expected);
}
#[tokio::test]
async fn subscribe_and_unsubscribe_with_wrong_id() {
let (rpc, _) = setup_io_handler(TestVoterState);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment