From 851f795001a9164572d02606587ddc5193bdfd2d Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Thu, 14 Sep 2023 16:38:15 +0200 Subject: fix: output traces for op sanitizer in more cases (#20494) This adds traces for the "started outside test, closed inside test" case. --- cli/tools/test/mod.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'cli/tools') diff --git a/cli/tools/test/mod.rs b/cli/tools/test/mod.rs index 87ca7f3f5..0708e00c0 100644 --- a/cli/tools/test/mod.rs +++ b/cli/tools/test/mod.rs @@ -433,6 +433,13 @@ pub async fn test_specifier( let mut coverage_collector = worker.maybe_setup_coverage_collector().await?; + if options.trace_ops { + worker.execute_script_static( + located_script_name!(), + "Deno[Deno.internal].core.enableOpCallTracing();", + )?; + } + // We execute the main module as a side module so that import.meta.main is not set. match worker.execute_side_module_possibly_with_npm().await { Ok(()) => {} @@ -450,12 +457,7 @@ pub async fn test_specifier( } let mut worker = worker.into_main_worker(); - if options.trace_ops { - worker.js_runtime.execute_script_static( - located_script_name!(), - "Deno[Deno.internal].core.enableOpCallTracing();", - )?; - } + worker.dispatch_load_event(located_script_name!())?; let tests = { -- cgit v1.2.3