Extended sleep in tests

This commit is contained in:
Dennis Schwerdel 2019-02-21 17:50:44 +01:00
parent ac6e7f1ffd
commit be27f79b8c
1 changed files with 2 additions and 2 deletions

View File

@ -397,10 +397,10 @@ fn encode_decode_cmd() {
peers.push(SocketAddr::from_str("6.6.6.6:53").unwrap()); peers.push(SocketAddr::from_str("6.6.6.6:53").unwrap());
let file = tempfile::NamedTempFile::new().expect("Failed to create temp file"); let file = tempfile::NamedTempFile::new().expect("Failed to create temp file");
assert!(ser.write_to_cmd(&peers, &format!("echo $beacon > {}", file.path().display())).is_ok()); assert!(ser.write_to_cmd(&peers, &format!("echo $beacon > {}", file.path().display())).is_ok());
thread::sleep(Duration::from_millis(10)); thread::sleep(Duration::from_millis(100));
let res = ser.read_from_cmd(&format!("cat {}", file.path().display()), None); let res = ser.read_from_cmd(&format!("cat {}", file.path().display()), None);
assert!(res.is_ok()); assert!(res.is_ok());
thread::sleep(Duration::from_millis(10)); thread::sleep(Duration::from_millis(100));
let peers2 = ser.get_cmd_results(); let peers2 = ser.get_cmd_results();
assert!(peers2.is_some()); assert!(peers2.is_some());
assert_eq!(format!("{:?}", peers), format!("{:?}", peers2.unwrap())); assert_eq!(format!("{:?}", peers), format!("{:?}", peers2.unwrap()));