We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab9d655 commit fd6ae40Copy full SHA for fd6ae40
tests/timeout.rs
@@ -0,0 +1,22 @@
1
+use std::time::Duration;
2
+
3
+use async_std::future::timeout;
4
+use async_std::task;
5
6
+#[test]
7
+fn timeout_future_many() {
8
+ task::block_on(async {
9
+ let futures = (0..100)
10
+ .map(|i| {
11
+ timeout(Duration::from_millis(i * 10), async move {
12
+ task::sleep(Duration::from_millis(i)).await;
13
+ Ok::<(), async_std::future::TimeoutError>(())
14
+ })
15
16
+ .collect::<Vec<_>>();
17
18
+ for future in futures {
19
+ future.await.unwrap().unwrap();
20
+ }
21
+ });
22
+}
0 commit comments