File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,7 +56,9 @@ async-fd = ["dep:compio-io"]
5656notify-always = [" compio-executor/notify-always" ]
5757
5858current_thread_id = []
59- nightly = [" current_thread_id" ]
59+
60+ sanitize = []
61+ nightly = [" current_thread_id" , " sanitize" ]
6062
6163[[test ]]
6264name = " custom_loop"
Original file line number Diff line number Diff line change @@ -14,3 +14,19 @@ fn panic_spawn() {
1414 panic ! ( "another panic" ) ;
1515 } )
1616}
17+
18+ #[ test]
19+ #[ should_panic]
20+ #[ cfg_attr( feature = "sanitize" , cfg_attr( sanitize = "address" , ignore) ) ]
21+ fn simple_drop ( ) {
22+ compio_runtime:: Runtime :: new ( ) . unwrap ( ) . block_on ( async {
23+ let handle = compio_runtime:: spawn ( async {
24+ sleep ( Duration :: from_millis ( 100 ) ) . await ;
25+ } ) ;
26+ // Register the waker for handle here to make sure that when the task gets
27+ // dropped, `has_waker` check returns true
28+ compio_runtime:: spawn ( handle) . detach ( ) ;
29+ sleep ( Duration :: from_millis ( 100 ) ) . await ;
30+ panic ! ( "Main future panics" ) ;
31+ } )
32+ }
You can’t perform that action at this time.
0 commit comments