mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-09 00:00:08 +02:00
stream: handle overflowing timer durations (#8354)
This commit is contained in:
@@ -107,3 +107,11 @@ async fn no_timeouts() {
|
||||
assert_ready_eq!(stream.poll_next(), Some(Ok(5)));
|
||||
assert_ready_eq!(stream.poll_next(), None);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn duration_max_does_not_overflow() {
|
||||
let stream = stream::iter([1]).timeout(Duration::MAX);
|
||||
let mut stream = task::spawn(stream);
|
||||
|
||||
assert_ready_eq!(stream.poll_next(), Some(Ok(1)));
|
||||
}
|
||||
|
||||
@@ -26,3 +26,10 @@ async fn usage() {
|
||||
|
||||
assert_ready!(stream.poll_next());
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn duration_max_does_not_overflow() {
|
||||
let mut stream = task::spawn(futures::stream::iter([1]).throttle(Duration::MAX));
|
||||
|
||||
assert_ready_eq!(stream.poll_next(), Some(1));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user