diff options
author | Matt Mastracci <matthew@mastracci.com> | 2024-02-28 09:12:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-28 09:12:43 -0700 |
commit | a3f982c1d58a4c96377348aae203ab3f2c234729 (patch) | |
tree | 47a2968e50fa80c25b7fd4e8f9edb72f024f895d /cli/tools/test | |
parent | c2c4e745a5db4f2e53aa70bf22b6c828fa1b4040 (diff) |
chore(cli): rename `--trace-ops` to `--trace-leaks` (#22598)
As we add tracing to more types of runtime activity, `--trace-ops` is
less useful of a name. `--trace-leaks` better reflects that this feature
traces both ops and timers, and will eventually trace resource opening
as well.
This keeps `--trace-ops` as an alias for `--trace-leaks`, but prints a
warning to the console suggesting migration to `--trace-leaks`.
One test continues to use `--trace-ops` to test the deprecation warning.
---------
Signed-off-by: Matt Mastracci <matthew@mastracci.com>
Diffstat (limited to 'cli/tools/test')
-rw-r--r-- | cli/tools/test/fmt.rs | 10 | ||||
-rw-r--r-- | cli/tools/test/mod.rs | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/cli/tools/test/fmt.rs b/cli/tools/test/fmt.rs index fe2007025..7dc9ceabf 100644 --- a/cli/tools/test/fmt.rs +++ b/cli/tools/test/fmt.rs @@ -107,7 +107,7 @@ fn format_sanitizer_accum( } let mut output = vec![]; - let mut needs_trace_ops = false; + let mut needs_trace_leaks = false; for ((item_type, item_name, trace), count) in accum.into_iter() { if item_type == RuntimeActivityType::Resource { let (name, action1, action2) = pretty_resource_name(&item_name); @@ -143,7 +143,7 @@ fn format_sanitizer_accum( value += &if let Some(trace) = trace { format!(" The operation {tense} started here:\n{trace}") } else { - needs_trace_ops = true; + needs_trace_leaks = true; String::new() }; output.push(value); @@ -157,8 +157,8 @@ fn format_sanitizer_accum( ); } } - if needs_trace_ops { - (output, vec!["To get more details where ops were leaked, run again with --trace-ops flag.".to_owned()]) + if needs_trace_leaks { + (output, vec!["To get more details where leaks occurred, run again with the --trace-leaks flag.".to_owned()]) } else { (output, vec![]) } @@ -360,5 +360,5 @@ mod tests { // https://github.com/denoland/deno/issues/13938 leak_format_test!(op_unknown, true, [RuntimeActivity::AsyncOp(0, None, "op_unknown")], " - An async call to op_unknown was started in this test, but never completed.\n\ - To get more details where ops were leaked, run again with --trace-ops flag.\n"); + To get more details where leaks occurred, run again with the --trace-leaks flag.\n"); } diff --git a/cli/tools/test/mod.rs b/cli/tools/test/mod.rs index 526f48c21..13c1c3ed6 100644 --- a/cli/tools/test/mod.rs +++ b/cli/tools/test/mod.rs @@ -440,7 +440,7 @@ struct TestSpecifiersOptions { pub struct TestSpecifierOptions { pub shuffle: Option<u64>, pub filter: TestFilter, - pub trace_ops: bool, + pub trace_leaks: bool, } impl TestSummary { @@ -559,7 +559,7 @@ async fn test_specifier_inner( let mut coverage_collector = worker.maybe_setup_coverage_collector().await?; - if options.trace_ops { + if options.trace_leaks { worker.execute_script_static( located_script_name!(), "Deno[Deno.internal].core.setLeakTracingEnabled(true);", @@ -1503,7 +1503,7 @@ pub async fn run_tests( specifier: TestSpecifierOptions { filter: TestFilter::from_flag(&test_options.filter), shuffle: test_options.shuffle, - trace_ops: test_options.trace_ops, + trace_leaks: test_options.trace_leaks, }, }, ) @@ -1647,7 +1647,7 @@ pub async fn run_tests_with_watch( specifier: TestSpecifierOptions { filter: TestFilter::from_flag(&test_options.filter), shuffle: test_options.shuffle, - trace_ops: test_options.trace_ops, + trace_leaks: test_options.trace_leaks, }, }, ) |