@@ -968,6 +968,8 @@ fn interrupt_random_kill_stress_test() {
968968 NUM_THREADS , ITERATIONS_PER_THREAD
969969 ) ;
970970
971+ let start_time = std:: time:: Instant :: now ( ) ;
972+
971973 // Spawn worker threads
972974 let mut thread_handles = vec ! [ ] ;
973975 for thread_id in 0 ..NUM_THREADS {
@@ -1221,11 +1223,15 @@ fn interrupt_random_kill_stress_test() {
12211223
12221224 // Progress reporting
12231225 let current_total = total_iterations_clone. load ( Ordering :: Relaxed ) ;
1224- if current_total. is_multiple_of ( 5000 ) {
1226+ if current_total. is_multiple_of ( 1000 ) {
1227+ let elapsed = start_time. elapsed ( ) ;
12251228 println ! (
1226- "Progress: {}/{} iterations completed " ,
1229+ "Progress: {}/{} iterations ({:.1}s elapsed, {} restores, {} replacements) " ,
12271230 current_total,
1228- NUM_THREADS * ITERATIONS_PER_THREAD
1231+ NUM_THREADS * ITERATIONS_PER_THREAD ,
1232+ elapsed. as_secs_f64( ) ,
1233+ actually_killed_count_clone. load( Ordering :: Relaxed ) ,
1234+ sandbox_replaced_count_clone. load( Ordering :: Relaxed ) ,
12291235 ) ;
12301236 }
12311237
@@ -1721,14 +1727,19 @@ fn fill_heap_and_cause_exception() {
17211727#[ test]
17221728#[ cfg( target_os = "windows" ) ]
17231729fn interrupt_cancel_delete_race ( ) {
1730+ use std:: sync:: atomic:: AtomicUsize ;
1731+
17241732 const NUM_THREADS : usize = 8 ;
17251733 const NUM_KILL_THREADS : usize = 4 ;
17261734 const ITERATIONS_PER_THREAD : usize = 1000 ;
17271735
1736+ let total_iterations = Arc :: new ( AtomicUsize :: new ( 0 ) ) ;
1737+ let start_time = std:: time:: Instant :: now ( ) ;
17281738 let mut handles = vec ! [ ] ;
17291739
17301740 for _ in 0 ..NUM_THREADS {
1731- handles. push ( thread:: spawn ( || {
1741+ let total_iterations_clone = Arc :: clone ( & total_iterations) ;
1742+ handles. push ( thread:: spawn ( move || {
17321743 for _ in 0 ..ITERATIONS_PER_THREAD {
17331744 let mut sandbox = new_rust_sandbox ( ) ;
17341745 let interrupt_handle = sandbox. interrupt_handle ( ) ;
@@ -1760,6 +1771,16 @@ fn interrupt_cancel_delete_race() {
17601771 for kill_handle in kill_handles {
17611772 kill_handle. join ( ) . expect ( "Kill thread panicked!" ) ;
17621773 }
1774+
1775+ let current = total_iterations_clone. fetch_add ( 1 , Ordering :: Relaxed ) + 1 ;
1776+ if current % 500 == 0 {
1777+ println ! (
1778+ "interrupt_cancel_delete_race: {}/{} iterations ({:.1}s elapsed)" ,
1779+ current,
1780+ NUM_THREADS * ITERATIONS_PER_THREAD ,
1781+ start_time. elapsed( ) . as_secs_f64( ) ,
1782+ ) ;
1783+ }
17631784 }
17641785 } ) ) ;
17651786 }
0 commit comments