Skip to content

Commit 7a28bb7

Browse files
committed
Rebase upstream
1 parent 8d1b9ea commit 7a28bb7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

governor/tests/future.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
#![cfg(feature = "std")]
22

3+
use all_asserts::assert_ge;
34
use futures::executor::block_on;
45
use governor::{Quota, RateLimiter};
56
use nonzero_ext::*;
67
use std::sync::Arc;
78
use std::thread;
9+
use std::time::{Duration, Instant};
10+
11+
/// The time that our "real" clock tests may take, indicating that no
12+
/// blocking waits have occurred.
13+
const MAX_TEST_RUN_DURATION: Duration = Duration::from_micros(200);
814

915
#[test]
1016
fn pauses() {
@@ -75,7 +81,7 @@ fn proceeds_keyed_n() {
7581
let lim = RateLimiter::keyed(Quota::per_second(nonzero!(3u32)));
7682
let i = Instant::now();
7783
block_on(lim.until_key_n_ready(&1u32, nonzero!(2u32))).unwrap();
78-
assert_le!(i.elapsed(), MAX_TEST_RUN_DURATION);
84+
all_asserts::assert_le!(i.elapsed(), MAX_TEST_RUN_DURATION);
7985
}
8086

8187
#[test]

0 commit comments

Comments
 (0)