@@ -11,18 +11,16 @@ mod supervisor;
1111
1212use supervisor:: RuntimeHandles ;
1313
14- use crate :: config:: ProcessDefinition ;
1514use crate :: process:: ManagedProcess ;
1615use anyhow:: Result ;
1716use log:: warn;
18- use std:: sync:: Arc ;
1917use tokio:: sync:: mpsc;
2018use tonic:: Status ;
2119
2220pub use process_manager:: ProcessManager ;
2321pub use supervisor:: Supervisor ;
2422
25- #[ cfg( test) ]
23+ #[ cfg( all ( test, unix ) ) ]
2624pub ( crate ) use supervisor:: spawn_command_loop_for_tests;
2725
2826pub ( crate ) struct ExitEvent {
@@ -125,10 +123,14 @@ fn spawn_watcher(proc: &mut ManagedProcess, tx: mpsc::Sender<ExitEvent>) {
125123#[ cfg( test) ]
126124mod tests {
127125 use super :: * ;
128- use crate :: config:: { ConfigLoader , MutableConfigLoader , ProcessConfig , RestartPolicy , StaticConfigLoader } ;
126+ use crate :: config:: {
127+ ConfigLoader , MutableConfigLoader , ProcessConfig , ProcessDefinition , RestartPolicy ,
128+ StaticConfigLoader ,
129+ } ;
129130 use crate :: state:: ProcessState ;
130131 use crate :: test_helpers;
131132 use crate :: uuid_gen:: { SequentialUuidGenerator , UuidGenerator , V4UuidGenerator } ;
133+ use std:: sync:: Arc ;
132134
133135 fn loader ( defs : Vec < ProcessDefinition > ) -> Arc < dyn ConfigLoader > {
134136 Arc :: new ( StaticConfigLoader :: new ( defs) )
@@ -138,8 +140,7 @@ mod tests {
138140 Arc :: new ( V4UuidGenerator )
139141 }
140142
141- fn test_runtime_handles (
142- ) -> (
143+ fn test_runtime_handles ( ) -> (
143144 RuntimeHandles ,
144145 mpsc:: Receiver < ExitEvent > ,
145146 mpsc:: Receiver < PendingRestart > ,
@@ -255,8 +256,7 @@ mod tests {
255256 "reload should start the process with fresh counters"
256257 ) ;
257258
258- mgr. complete_restart ( stale_pending, & handles)
259- . await ;
259+ mgr. complete_restart ( stale_pending, & handles) . await ;
260260 let pid = mgr. processes ( ) . await [ 0 ] . pid ( ) . unwrap ( ) ;
261261 test_helpers:: cleanup_process ( pid) ;
262262 Ok ( ( ) )
@@ -310,8 +310,7 @@ mod tests {
310310 mgr. handle_reload_config ( & handles) . await ?;
311311 assert ! ( !mgr. processes( ) . await [ 0 ] . is_running( ) ) ;
312312
313- mgr. complete_restart ( stale_pending, & handles)
314- . await ;
313+ mgr. complete_restart ( stale_pending, & handles) . await ;
315314 assert ! (
316315 !mgr. processes( ) . await [ 0 ] . is_running( ) ,
317316 "config reload should discard pending crash retries for failed auto_start=false processes"
0 commit comments