File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -69,18 +69,17 @@ async fn test_runtime() -> Result<()> {
69
69
Ok ( ( ) )
70
70
}
71
71
72
- #[ tokio:: test( flavor = "multi_thread" , worker_threads = 1 ) ]
72
+ #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
73
73
async fn test_shutdown_long_run_runtime ( ) -> Result < ( ) > {
74
74
let runtime = Runtime :: with_default_worker_threads ( ) ?;
75
75
76
76
runtime. spawn ( GLOBAL_TASK , async move {
77
- std :: thread :: sleep ( Duration :: from_secs ( 6 ) ) ;
77
+ tokio :: time :: sleep ( Duration :: from_secs ( 6 ) ) . await ;
78
78
} ) ;
79
79
80
80
let instant = Instant :: now ( ) ;
81
81
drop ( runtime) ;
82
- assert ! ( instant. elapsed( ) >= Duration :: from_secs( 3 ) ) ;
83
- assert ! ( instant. elapsed( ) < Duration :: from_secs( 4 ) ) ;
82
+ assert ! ( instant. elapsed( ) < Duration :: from_secs( 6 ) ) ;
84
83
85
84
Ok ( ( ) )
86
85
}
You can’t perform that action at this time.
0 commit comments