We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e3bf89f commit ec5a0d7Copy full SHA for ec5a0d7
tests/io_timeout.rs
@@ -7,10 +7,9 @@ use async_std::task;
7
#[should_panic(expected = "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