File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -261,6 +261,17 @@ sp_core::wasm_export_functions! {
261261 wasm_tracing:: exit( span_id)
262262 }
263263
264+ fn test_nested_spans( ) {
265+ sp_io:: init_tracing( ) ;
266+ let span_id = wasm_tracing:: enter_span( Default :: default ( ) ) ;
267+ {
268+ sp_io:: init_tracing( ) ;
269+ let span_id = wasm_tracing:: enter_span( Default :: default ( ) ) ;
270+ wasm_tracing:: exit( span_id) ;
271+ }
272+ wasm_tracing:: exit( span_id) ;
273+ }
274+
264275 fn returns_mutable_static( ) -> u64 {
265276 unsafe {
266277 MUTABLE_STATIC += 1 ;
Original file line number Diff line number Diff line change @@ -719,6 +719,15 @@ fn wasm_tracing_should_work(wasm_method: WasmExecutionMethod) {
719719 assert_eq ! ( span_datum. target, "default" ) ;
720720 assert_eq ! ( span_datum. name, "" ) ;
721721 assert_eq ! ( values. bool_values. get( "wasm" ) . unwrap( ) , & true ) ;
722+
723+ call_in_wasm (
724+ "test_nested_spans" ,
725+ Default :: default ( ) ,
726+ wasm_method,
727+ & mut ext,
728+ ) . unwrap ( ) ;
729+ let len = traces. lock ( ) . unwrap ( ) . len ( ) ;
730+ assert_eq ! ( len, 2 ) ;
722731}
723732
724733#[ test_case( WasmExecutionMethod :: Interpreted ) ]
Original file line number Diff line number Diff line change @@ -1093,7 +1093,7 @@ mod tracing_setup {
10931093 } ;
10941094 use super :: { wasm_tracing, Crossing } ;
10951095
1096- const TRACING_SET : AtomicBool = AtomicBool :: new ( false ) ;
1096+ static TRACING_SET : AtomicBool = AtomicBool :: new ( false ) ;
10971097
10981098
10991099 /// The PassingTracingSubscriber implements `tracing_core::Subscriber`
You can’t perform that action at this time.
0 commit comments