diff options
| author | Mohammad Sulaiman <mohammad.sulaiman@exalt.ps> | 2024-11-05 08:39:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-05 06:39:05 +0000 |
| commit | 89f0b796bd442ff352c3f93f69156ca6d85bfd5e (patch) | |
| tree | 3ac2a58c6d85f6af57eb2c6b07b1f2d0e8687b3a /tests/specs/run/worker_drop_handle_race | |
| parent | f9a05068d6de247574fb764044a446d1d7ed2e9b (diff) | |
chore: deprecate run itests (#26444)
Diffstat (limited to 'tests/specs/run/worker_drop_handle_race')
4 files changed, 27 insertions, 0 deletions
diff --git a/tests/specs/run/worker_drop_handle_race/__test__.jsonc b/tests/specs/run/worker_drop_handle_race/__test__.jsonc new file mode 100644 index 000000000..cc600d5ef --- /dev/null +++ b/tests/specs/run/worker_drop_handle_race/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet --reload --allow-read worker_drop_handle_race.js", + "output": "worker_drop_handle_race.js.out", + "exitCode": 1 +} diff --git a/tests/specs/run/worker_drop_handle_race/drop_handle_race.js b/tests/specs/run/worker_drop_handle_race/drop_handle_race.js new file mode 100644 index 000000000..30676a600 --- /dev/null +++ b/tests/specs/run/worker_drop_handle_race/drop_handle_race.js @@ -0,0 +1,3 @@ +setTimeout(() => { + throw new Error(); +}, 1000); diff --git a/tests/specs/run/worker_drop_handle_race/worker_drop_handle_race.js b/tests/specs/run/worker_drop_handle_race/worker_drop_handle_race.js new file mode 100644 index 000000000..ef9bcbe07 --- /dev/null +++ b/tests/specs/run/worker_drop_handle_race/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("./drop_handle_race.js"), + { type: "module" }, +); diff --git a/tests/specs/run/worker_drop_handle_race/worker_drop_handle_race.js.out b/tests/specs/run/worker_drop_handle_race/worker_drop_handle_race.js.out new file mode 100644 index 000000000..a1c2e30ad --- /dev/null +++ b/tests/specs/run/worker_drop_handle_race/worker_drop_handle_race.js.out @@ -0,0 +1,7 @@ +error: Uncaught (in worker "") Error + throw new Error(); + ^ + at [WILDCARD]/drop_handle_race.js:2:9 + at [WILDCARD] +error: Uncaught (in promise) Error: Unhandled error in child worker. + at Worker.#pollControl [WILDCARD] |
