Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit efb701a

Browse files
committed
fix ignored system test
1 parent 6368752 commit efb701a

File tree

1 file changed

+2
-26
lines changed

1 file changed

+2
-26
lines changed

client/rpc/src/system/tests.rs

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,6 @@ async fn system_network_reserved_peers() {
337337
);
338338
}
339339

340-
// TODO: (dp) This hangs. Likely have to make this a normal test and execute the RPC calls manually
341-
// on an executor.
342-
#[ignore]
343340
#[test]
344341
fn test_add_reset_log_filter() {
345342
const EXPECTED_BEFORE_ADD: &'static str = "EXPECTED_BEFORE_ADD";
@@ -353,11 +350,11 @@ fn test_add_reset_log_filter() {
353350
let line = line.expect("Failed to read bytes");
354351
if line.contains("add_reload") {
355352
let filter = to_raw_value(&"test_after_add").unwrap();
356-
let fut = async move { api(None).call("system_addLogFilter", Some(filter)).await };
353+
let fut = async move { api(None).call_with("system_addLogFilter", [filter]).await };
357354
futures::executor::block_on(fut).expect("`system_add_log_filter` failed");
358355
} else if line.contains("add_trace") {
359356
let filter = to_raw_value(&"test_before_add=trace").unwrap();
360-
let fut = async move { api(None).call("system_addLogFilter", Some(filter)).await };
357+
let fut = async move { api(None).call_with("system_addLogFilter", [filter]).await };
361358
futures::executor::block_on(fut).expect("`system_add_log_filter (trace)` failed");
362359
} else if line.contains("reset") {
363360
let fut = async move { api(None).call("system_resetLogFilter", None).await };
@@ -385,27 +382,6 @@ fn test_add_reset_log_filter() {
385382
let mut child_out = BufReader::new(child_stderr);
386383
let mut child_in = child_process.stdin.take().expect("Could not get child stdin");
387384

388-
let mut read_line = || {
389-
let mut line = String::new();
390-
child_out.read_line(&mut line).expect("Reading a line");
391-
println!("[main test, readline] Read '{:?}'", line);
392-
line
393-
};
394-
395-
// Call this test again to enter the log generation / filter reload block
396-
let test_executable = env::current_exe().expect("Unable to get current executable!");
397-
let mut child_process = Command::new(test_executable)
398-
.env("TEST_LOG_FILTER", "1")
399-
.args(&["--nocapture", "test_add_reset_log_filter"])
400-
.stdin(Stdio::piped())
401-
.stderr(Stdio::piped())
402-
.spawn()
403-
.unwrap();
404-
405-
let child_stderr = child_process.stderr.take().expect("Could not get child stderr");
406-
let mut child_out = BufReader::new(child_stderr);
407-
let mut child_in = child_process.stdin.take().expect("Could not get child stdin");
408-
409385
let mut read_line = || {
410386
let mut line = String::new();
411387
child_out.read_line(&mut line).expect("Reading a line");

0 commit comments

Comments
 (0)