File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33#[ cfg( test) ]
44mod tests {
55 use std:: time:: Duration ;
6- use tokio:: signal;
7- use tokio:: time:: timeout;
6+ use tokio:: { signal, time:: timeout} ;
87
98 /// Test that SIGTERM signal handler can be created (Unix only)
109 #[ tokio:: test]
@@ -47,9 +46,11 @@ mod tests {
4746 /// Test the tokio::select! pattern used in main
4847 #[ tokio:: test]
4948 async fn test_select_pattern ( ) {
50- use std:: future:: Future ;
51- use std:: pin:: Pin ;
52- use std:: task:: { Context , Poll } ;
49+ use std:: {
50+ future:: Future ,
51+ pin:: Pin ,
52+ task:: { Context , Poll } ,
53+ } ;
5354
5455 // Mock future that never completes (simulates node_exit_future)
5556 struct NeverComplete ;
@@ -75,7 +76,7 @@ mod tests {
7576 let shutdown_signal = CompleteImmediately ;
7677
7778 // Test the select logic matches what we use in main.rs
78- let result = tokio:: select! {
79+ let result: Result < ( ) , Box < dyn std :: error :: Error + Send + Sync > > = tokio:: select! {
7980 result = & mut mock_node_exit => {
8081 panic!( "Node exit future should not complete in this test" ) ;
8182 }
Original file line number Diff line number Diff line change 22
33#[ cfg( test) ]
44mod tests {
5- use super :: * ;
6- use std:: process;
75 use std:: time:: Duration ;
8- use tokio:: signal;
9- use tokio:: time:: timeout;
6+ use tokio:: { signal, time:: timeout} ;
107
118 /// Test that SIGTERM triggers graceful shutdown
129 #[ tokio:: test]
@@ -118,9 +115,11 @@ mod tests {
118115 /// Test that the tokio::select! logic works correctly with mock futures
119116 #[ tokio:: test]
120117 async fn test_select_logic_with_mock_futures ( ) {
121- use std:: future:: Future ;
122- use std:: pin:: Pin ;
123- use std:: task:: { Context , Poll } ;
118+ use std:: {
119+ future:: Future ,
120+ pin:: Pin ,
121+ task:: { Context , Poll } ,
122+ } ;
124123
125124 // Mock future that never completes (simulates node_exit_future)
126125 struct NeverComplete ;
@@ -146,7 +145,7 @@ mod tests {
146145 let shutdown_signal = CompleteImmediately ;
147146
148147 // Test the select logic
149- let result = tokio:: select! {
148+ let result: Result < ( ) , Box < dyn std :: error :: Error + Send + Sync > > = tokio:: select! {
150149 result = & mut mock_node_exit => {
151150 panic!( "Node exit future should not complete in this test" ) ;
152151 }
You can’t perform that action at this time.
0 commit comments