feat: deno test --trace-ops (#13770)

This commit adds "--trace-ops" flag to "deno test" subcommand.

This flag enables saving of stack traces for async ops, that before were always
saved. While the feature proved to be very useful it comes with a significant performance
hit, it's caused by excessive source mapping of stack frames.
This commit is contained in:
Bartek Iwańczuk 2022-02-25 16:14:46 +01:00 committed by GitHub
parent 111c343281
commit d332bf1132
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 78 additions and 7 deletions

View file

@ -208,9 +208,16 @@
}
}
throw `Test case is leaking async ops.
let msg = `Test case is leaking async ops.
- ${ArrayPrototypeJoin(details, "\n - ")}`;
if (!core.isOpCallTracingEnabled()) {
msg +=
`\n\nTo get more details where ops were leaked, run again with --trace-ops flag.`;
}
throw msg;
};
}