Increase tolerance in SSE heartbeat test.

This commit is contained in:
Sergio Benitez 2021-06-02 22:35:17 -07:00
parent 9f5a587dc3
commit 559320d155
1 changed files with 3 additions and 3 deletions

View File

@ -720,13 +720,13 @@ mod sse_tests {
use futures::future::ready; use futures::future::ready;
use futures::stream::{once, iter, StreamExt}; use futures::stream::{once, iter, StreamExt};
// Set a heartbeat interval of 200ms. Send nothing for 500ms. We should // Set a heartbeat interval of 250ms. Send nothing for 600ms. We should
// get 2 or 3 heartbeats, the latter if one is sent eagerly. // get 2 or 3 heartbeats, the latter if one is sent eagerly.
let raw = stream!(time::sleep(Duration::from_millis(500)).await;) let raw = stream!(time::sleep(Duration::from_millis(600)).await;)
.map(|_| unreachable!()); .map(|_| unreachable!());
let string = EventStream::from(raw) let string = EventStream::from(raw)
.heartbeat(Duration::from_millis(200)) .heartbeat(Duration::from_millis(250))
.into_string(); .into_string();
match string.as_str() { match string.as_str() {