@@ -93,35 +93,35 @@ fn blocking_queue_depth() {
9393}
9494
9595#[ test]
96- fn num_active_tasks ( ) {
96+ fn num_alive_tasks ( ) {
9797 let rt = current_thread ( ) ;
9898 let metrics = rt. metrics ( ) ;
99- assert_eq ! ( 0 , metrics. num_active_tasks ( ) ) ;
99+ assert_eq ! ( 0 , metrics. num_alive_tasks ( ) ) ;
100100 rt. block_on ( rt. spawn ( async move {
101- assert_eq ! ( 1 , metrics. num_active_tasks ( ) ) ;
101+ assert_eq ! ( 1 , metrics. num_alive_tasks ( ) ) ;
102102 } ) )
103103 . unwrap ( ) ;
104104
105- assert_eq ! ( 0 , rt. metrics( ) . num_active_tasks ( ) ) ;
105+ assert_eq ! ( 0 , rt. metrics( ) . num_alive_tasks ( ) ) ;
106106
107107 let rt = threaded ( ) ;
108108 let metrics = rt. metrics ( ) ;
109- assert_eq ! ( 0 , metrics. num_active_tasks ( ) ) ;
109+ assert_eq ! ( 0 , metrics. num_alive_tasks ( ) ) ;
110110 rt. block_on ( rt. spawn ( async move {
111- assert_eq ! ( 1 , metrics. num_active_tasks ( ) ) ;
111+ assert_eq ! ( 1 , metrics. num_alive_tasks ( ) ) ;
112112 } ) )
113113 . unwrap ( ) ;
114114
115115 // try for 10 seconds to see if this eventually succeeds.
116116 // wake_join() is called before the task is released, so in multithreaded
117117 // code, this means we sometimes exit the block_on before the counter decrements.
118118 for _ in 0 ..100 {
119- if rt. metrics ( ) . num_active_tasks ( ) == 0 {
119+ if rt. metrics ( ) . num_alive_tasks ( ) == 0 {
120120 break ;
121121 }
122122 std:: thread:: sleep ( std:: time:: Duration :: from_millis ( 100 ) ) ;
123123 }
124- assert_eq ! ( 0 , rt. metrics( ) . num_active_tasks ( ) ) ;
124+ assert_eq ! ( 0 , rt. metrics( ) . num_alive_tasks ( ) ) ;
125125}
126126
127127#[ test]
0 commit comments