| 351 | // pollables because both are awaiting, and one with just the later pollable. |
| 352 | #[test] |
| 353 | fn subscribe_multiple_durations_zipped() { |
| 354 | crate::runtime::block_on(async { |
| 355 | let reactor = Reactor::current(); |
| 356 | let start = wasip2::clocks::monotonic_clock::now(); |
| 357 | let soon = wasip2::clocks::monotonic_clock::subscribe_duration(10_000_000); |
| 358 | let later = wasip2::clocks::monotonic_clock::subscribe_duration(40_000_000); |
| 359 | let soon = reactor.schedule(soon); |
| 360 | let later = reactor.schedule(later); |
| 361 | |
| 362 | futures_lite::future::zip( |
| 363 | async move { |
| 364 | soon.wait_for().await; |
| 365 | println!( |
| 366 | "*** subscribe_duration(soon) ready ({})", |
| 367 | wasip2::clocks::monotonic_clock::now() - start |
| 368 | ); |
| 369 | }, |
| 370 | async move { |
| 371 | later.wait_for().await; |
| 372 | println!( |
| 373 | "*** subscribe_duration(later) ready ({})", |
| 374 | wasip2::clocks::monotonic_clock::now() - start |
| 375 | ); |
| 376 | }, |
| 377 | ) |
| 378 | .await; |
| 379 | }) |
| 380 | } |
| 381 | |
| 382 | #[test] |
| 383 | fn progresses_wasi_independent_futures() { |