summaryrefslogtreecommitdiff
path: root/tests/specs/bench/finally_timeout
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-04-29 10:08:27 -0400
committerGitHub <noreply@github.com>2024-04-29 10:08:27 -0400
commitda52058a945999d486b07700d2834f027a65947c (patch)
treeb6031c274cbc36dcefc6d681473e366cdb208c89 /tests/specs/bench/finally_timeout
parentb02ffec37c73be8a73b95b33b32efa693e84e01b (diff)
chore: migrate bench, publish, and more itests to spec tests (#23584)
Diffstat (limited to 'tests/specs/bench/finally_timeout')
-rw-r--r--tests/specs/bench/finally_timeout/__test__.jsonc5
-rw-r--r--tests/specs/bench/finally_timeout/finally_timeout.out11
-rw-r--r--tests/specs/bench/finally_timeout/finally_timeout.ts11
3 files changed, 27 insertions, 0 deletions
diff --git a/tests/specs/bench/finally_timeout/__test__.jsonc b/tests/specs/bench/finally_timeout/__test__.jsonc
new file mode 100644
index 000000000..621537204
--- /dev/null
+++ b/tests/specs/bench/finally_timeout/__test__.jsonc
@@ -0,0 +1,5 @@
+{
+ "args": "bench finally_timeout.ts",
+ "output": "finally_timeout.out",
+ "exitCode": 1
+}
diff --git a/tests/specs/bench/finally_timeout/finally_timeout.out b/tests/specs/bench/finally_timeout/finally_timeout.out
new file mode 100644
index 000000000..cefa18760
--- /dev/null
+++ b/tests/specs/bench/finally_timeout/finally_timeout.out
@@ -0,0 +1,11 @@
+Check [WILDCARD]/finally_timeout.ts
+cpu: [WILDCARD]
+runtime: deno [WILDCARD] ([WILDCARD])
+
+[WILDCARD]/finally_timeout.ts
+benchmark time (avg) iter/s (min … max) p75 p99 p995
+--------------------------------------------------------------- -----------------------------
+error error: Error: fail
+[WILDCARD]
+success [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD]
+error: Bench failed
diff --git a/tests/specs/bench/finally_timeout/finally_timeout.ts b/tests/specs/bench/finally_timeout/finally_timeout.ts
new file mode 100644
index 000000000..c49eb8da2
--- /dev/null
+++ b/tests/specs/bench/finally_timeout/finally_timeout.ts
@@ -0,0 +1,11 @@
+Deno.bench("error", function () {
+ const timer = setTimeout(() => null, 10000);
+ try {
+ throw new Error("fail");
+ } finally {
+ clearTimeout(timer);
+ }
+});
+
+Deno.bench("success", function () {
+});