From 53088e16de9728696df12b04670a0f2d5203592b Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Wed, 16 Feb 2022 19:53:17 +0100 Subject: feat(test): improved op sanitizer errors + traces (#13676) This commit improves the error messages for the `deno test` async op sanitizer. It does this in two ways: - it uses handwritten error messages for each op that could be leaking - it includes traces showing where each op was started This "async op tracing" functionality is a new feature in deno_core. It likely has a significant performance impact, which is why it is only enabled in tests. --- cli/tools/test.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cli/tools') diff --git a/cli/tools/test.rs b/cli/tools/test.rs index 5d99677f2..101dcb6b6 100644 --- a/cli/tools/test.rs +++ b/cli/tools/test.rs @@ -475,6 +475,12 @@ async fn test_specifier( None }; + // Enable op call tracing in core to enable better debugging of op sanitizer + // failures. + worker + .execute_script(&located_script_name!(), "Deno.core.enableOpCallTracing();") + .unwrap(); + // We only execute the specifier as a module if it is tagged with TestMode::Module or // TestMode::Both. if mode != TestMode::Documentation { -- cgit v1.2.3