File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 1
1
#![ cfg( feature = "std" ) ]
2
2
3
+ use all_asserts:: assert_ge;
3
4
use futures:: executor:: block_on;
4
5
use governor:: { Quota , RateLimiter } ;
5
6
use nonzero_ext:: * ;
6
7
use std:: sync:: Arc ;
7
8
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 ) ;
8
14
9
15
#[ test]
10
16
fn pauses ( ) {
@@ -75,7 +81,7 @@ fn proceeds_keyed_n() {
75
81
let lim = RateLimiter :: keyed ( Quota :: per_second ( nonzero ! ( 3u32 ) ) ) ;
76
82
let i = Instant :: now ( ) ;
77
83
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 ) ;
79
85
}
80
86
81
87
#[ test]
You can’t perform that action at this time.
0 commit comments