@@ -200,10 +200,12 @@ mod tests {
200
200
)
201
201
}
202
202
203
- async fn test_component_reload ( file : & mut File ,
204
- expected_component : & ComponentKey ,
205
- timeout : Duration ,
206
- mut receiver : SignalRx ) -> bool {
203
+ async fn test_component_reload (
204
+ file : & mut File ,
205
+ expected_component : & ComponentKey ,
206
+ timeout : Duration ,
207
+ mut receiver : SignalRx ,
208
+ ) -> bool {
207
209
file. write_all ( & [ 0 ] ) . unwrap ( ) ;
208
210
file. sync_all ( ) . unwrap ( ) ;
209
211
@@ -228,9 +230,10 @@ mod tests {
228
230
ComponentConfig :: new ( component_file_path. clone ( ) , http_component. clone ( ) ) ;
229
231
std:: fs:: create_dir ( & dir) . unwrap ( ) ;
230
232
let mut file = File :: create ( & file_path) . unwrap ( ) ;
231
- let mut component_files: Vec < std:: fs:: File > = component_file_path. iter ( ) . map ( |file| {
232
- File :: create ( & file) . unwrap ( )
233
- } ) . collect ( ) ;
233
+ let mut component_files: Vec < std:: fs:: File > = component_file_path
234
+ . iter ( )
235
+ . map ( |file| File :: create ( & file) . unwrap ( ) )
236
+ . collect ( ) ;
234
237
235
238
let ( signal_tx, signal_rx) = broadcast:: channel ( 128 ) ;
236
239
spawn_thread (
@@ -245,11 +248,25 @@ mod tests {
245
248
let signal_rx2 = signal_rx. resubscribe ( ) ;
246
249
let signal_rx3 = signal_rx. resubscribe ( ) ;
247
250
248
- if !test_component_reload ( & mut component_files[ 0 ] , & http_component, delay * 5 , signal_rx) . await {
251
+ if !test_component_reload (
252
+ & mut component_files[ 0 ] ,
253
+ & http_component,
254
+ delay * 5 ,
255
+ signal_rx,
256
+ )
257
+ . await
258
+ {
249
259
panic ! ( "Test timed out" ) ;
250
260
}
251
261
252
- if !test_component_reload ( & mut component_files[ 1 ] , & http_component, delay * 5 , signal_rx2) . await {
262
+ if !test_component_reload (
263
+ & mut component_files[ 1 ] ,
264
+ & http_component,
265
+ delay * 5 ,
266
+ signal_rx2,
267
+ )
268
+ . await
269
+ {
253
270
panic ! ( "Test timed out" ) ;
254
271
}
255
272
0 commit comments