File tree 2 files changed +5
-4
lines changed
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
- 188ce944ca056fb11402b8bc41fedfad7505cbb9
1
+ 98d239a60a476873e1de444763a555802aa41f6c
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ pub struct NoStealRuntime {
111
111
name : String ,
112
112
// Lazily init the runtimes so that they are created after pingora
113
113
// daemonize itself. Otherwise the runtime threads are lost.
114
- pools : Arc < OnceCell < Box < [ Handle ] > > > ,
114
+ pools : Pools ,
115
115
controls : OnceCell < Vec < Control > > ,
116
116
}
117
117
@@ -209,8 +209,8 @@ impl NoStealRuntime {
209
209
#[ test]
210
210
fn test_steal_runtime ( ) {
211
211
use tokio:: time:: { sleep, Duration } ;
212
-
213
- let rt = Runtime :: new_steal ( 2 , "test" ) ;
212
+ let threads = 2 ;
213
+ let rt = Runtime :: new_steal ( threads , "test" ) ;
214
214
let handle = rt. get_handle ( ) ;
215
215
let ret = handle. block_on ( async {
216
216
sleep ( Duration :: from_secs ( 1 ) ) . await ;
@@ -222,6 +222,7 @@ fn test_steal_runtime() {
222
222
1
223
223
} ) ;
224
224
225
+ assert_eq ! ( handle. metrics( ) . num_workers( ) , threads) ;
225
226
assert_eq ! ( ret, 1 ) ;
226
227
}
227
228
You can’t perform that action at this time.
0 commit comments