summaryrefslogtreecommitdiff
path: root/cli/js/40_test.js
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2024-02-13 19:44:37 -0700
committerGitHub <noreply@github.com>2024-02-13 19:44:37 -0700
commite23fc6d88cc26a234ef2795d0bea1fd2f7fb8bfa (patch)
treec0c08ba5520610be6f748aa9a75633d87baf5445 /cli/js/40_test.js
parent082f8128b8d784c599fdf2c0d857dbbe6abbc7fe (diff)
chore: deno_core bump (#22407)
- Adding `None` flag for warmup script. - Modify opcall trace interface to match new Rust implementation
Diffstat (limited to 'cli/js/40_test.js')
-rw-r--r--cli/js/40_test.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/cli/js/40_test.js b/cli/js/40_test.js
index b9735fc01..14adb5216 100644
--- a/cli/js/40_test.js
+++ b/cli/js/40_test.js
@@ -156,6 +156,7 @@ function populateOpNames() {
function assertOps(fn) {
/** @param desc {TestDescription | TestStepDescription} */
return async function asyncOpSanitizer(desc) {
+ let hasTraces = false;
if (opNames === null) populateOpNames();
const res = op_test_op_sanitizer_collect(
desc.id,
@@ -220,8 +221,7 @@ function assertOps(fn) {
message += ` This is often caused by not ${hint}.`;
}
const traces = [];
- for (const [id, { opName: traceOpName, stack }] of postTraces) {
- if (traceOpName !== opName) continue;
+ for (const [id, stack] of postTraces) {
if (MapPrototypeHas(preTraces, id)) continue;
ArrayPrototypePush(traces, stack);
}
@@ -232,6 +232,7 @@ function assertOps(fn) {
message += " The operations were started here:\n";
message += ArrayPrototypeJoin(traces, "\n\n");
}
+ hasTraces |= traces.length > 0;
ArrayPrototypePush(details, message);
} else if (diff < 0) {
const [name, hint] = op_test_op_sanitizer_get_async_message(opName);
@@ -247,8 +248,7 @@ function assertOps(fn) {
message += ` This is often caused by not ${hint}.`;
}
const traces = [];
- for (const [id, { opName: traceOpName, stack }] of preTraces) {
- if (opName !== traceOpName) continue;
+ for (const [id, stack] of preTraces) {
if (MapPrototypeHas(postTraces, id)) continue;
ArrayPrototypePush(traces, stack);
}
@@ -259,6 +259,7 @@ function assertOps(fn) {
message += " The operations were started here:\n";
message += ArrayPrototypeJoin(traces, "\n\n");
}
+ hasTraces |= traces.length > 0;
ArrayPrototypePush(details, message);
} else {
throw new Error("unreachable");
@@ -266,7 +267,7 @@ function assertOps(fn) {
}
return {
- failed: { leakedOps: [details, core.isOpCallTracingEnabled()] },
+ failed: { leakedOps: [details, hasTraces] },
};
};
}