summaryrefslogtreecommitdiff
path: root/tests/testdata/run/worker_drop_handle_race.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testdata/run/worker_drop_handle_race.js')
-rw-r--r--tests/testdata/run/worker_drop_handle_race.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/testdata/run/worker_drop_handle_race.js b/tests/testdata/run/worker_drop_handle_race.js
new file mode 100644
index 000000000..731a36964
--- /dev/null
+++ b/tests/testdata/run/worker_drop_handle_race.js
@@ -0,0 +1,12 @@
+// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+
+// https://github.com/denoland/deno/issues/11342
+// Test for a panic that happens when the main thread's event loop finishes
+// running while the worker's event loop is still spinning.
+
+// The exception thrown in the worker will not terminate the worker, but it will
+// propagate to the main thread and cause it to exit.
+new Worker(
+ import.meta.resolve("../workers/drop_handle_race.js"),
+ { type: "module" },
+);