We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e3bf89f commit 7fa9826Copy full SHA for 7fa9826
tests/io_timeout.rs
@@ -4,13 +4,12 @@ use async_std::io;
4
use async_std::task;
5
6
#[test]
7
-#[should_panic(expected = "timed out")]
+#[should_panic(expected = "future timed out")]
8
fn io_timeout_timedout() {
9
task::block_on(async {
10
- io::timeout(Duration::from_secs(1), async {
11
- let stdin = std::io::stdin();
12
- let mut line = String::new();
13
- let _n = stdin.read_line(&mut line)?;
+ io::timeout(Duration::from_micros(10), async {
+ task::sleep(Duration::from_micros(100)).await;
+
14
Ok(())
15
})
16
.await
0 commit comments