Skip to content

Commit

Permalink
Rebase upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
jmfrank63 committed Dec 30, 2023
1 parent 8d1b9ea commit 7a28bb7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion governor/tests/future.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
#![cfg(feature = "std")]

use all_asserts::assert_ge;
use futures::executor::block_on;
use governor::{Quota, RateLimiter};
use nonzero_ext::*;
use std::sync::Arc;
use std::thread;
use std::time::{Duration, Instant};

/// The time that our "real" clock tests may take, indicating that no
/// blocking waits have occurred.
const MAX_TEST_RUN_DURATION: Duration = Duration::from_micros(200);

#[test]
fn pauses() {
Expand Down Expand Up @@ -75,7 +81,7 @@ fn proceeds_keyed_n() {
let lim = RateLimiter::keyed(Quota::per_second(nonzero!(3u32)));
let i = Instant::now();
block_on(lim.until_key_n_ready(&1u32, nonzero!(2u32))).unwrap();
assert_le!(i.elapsed(), MAX_TEST_RUN_DURATION);
all_asserts::assert_le!(i.elapsed(), MAX_TEST_RUN_DURATION);
}

#[test]
Expand Down

0 comments on commit 7a28bb7

Please sign in to comment.