Skip to content

Attempt to fix unresolved terminate() promise #11376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

zawodskoj
Copy link
Contributor

@zawodskoj zawodskoj commented May 26, 2024

What does this PR do?

Worker.terminate() on JS-side expects "close" event to happen in order to complete promise, but this event will never happen, if worker is already terminated. The "solution" is to pass "already exited" flag to JS-side, so it can resolve the promise without any events.

More work is still required - there's some hacks to allow boolean to pass through incompatible Worker API

This PR may fix #11335 and #9998

  • Documentation or TypeScript types (it's okay to leave the rest blank in this case)
  • Code changes

How did you verify your code works?

None of the automated tests are provided, but the issues are now fixed and there are no big changes - just passing bool around

Copy link
Contributor

github-actions bot commented May 27, 2024

@gvilums, your commit has failing tests :(

💪 2 failing tests Darwin AARCH64

  • test/js/bun/test/test-test.test.ts 2 failing
  • test/js/node/child_process/child_process-node.test.js 1 failing

💻 3 failing tests Darwin x64 baseline

  • test/bundler/large_asset_regression.test.ts 1 failing
  • test/cli/install/bun-create.test.ts 2 failing
  • test/js/bun/test/test-test.test.ts 1 failing

💻 5 failing tests Darwin x64

  • test/cli/install/bun-create.test.ts 2 failing
  • test/cli/install/registry/bun-install-registry.test.ts 1 failing
  • test/js/bun/test/test-test.test.ts 1 failing
  • test/js/node/child_process/child_process-node.test.js 1 failing
  • test/js/web/workers/worker.test.ts 1 failing

🐧💪 1 failing tests Linux AARCH64

  • test/js/bun/test/test-test.test.ts 2 failing

🐧🖥 2 failing tests Linux x64 baseline

  • test/js/bun/test/test-test.test.ts 2 failing
  • test/js/deno/performance/performance.test.ts 1 failing

🐧🖥 1 failing tests Linux x64

  • test/js/bun/test/test-test.test.ts 2 failing

🪟💻 7 failing tests Windows x64 baseline

  • test/bundler/large_asset_regression.test.ts 1 failing
  • test/cli/install/bun-create.test.ts 1 failing
  • test/cli/install/bunx.test.ts 1 failing
  • test/js/bun/test/test-test.test.ts 2 failing
  • test/js/deno/performance/performance.test.ts 2 failing
  • test/js/node/watch/fs.watchFile.test.ts SIGKILL
  • test/js/third_party/jsonwebtoken/noTimestamp.test.js 1 failing

🪟💻 5 failing tests Windows x64

  • test/cli/install/bunx.test.ts 1 failing
  • test/integration/next-pages/test/dev-server.test.ts 1 failing
  • test/js/bun/test/test-test.test.ts 2 failing
  • test/js/node/watch/fs.watchFile.test.ts SIGKILL
  • test/js/web/fetch/fetch.tls.test.ts 1 failing

View logs

@zawodskoj
Copy link
Contributor Author

The best error of all times

image

@zawodskoj zawodskoj force-pushed the js-worker-terminate-fix branch from c5f28bc to a7c6452 Compare May 28, 2024 08:27
@zawodskoj
Copy link
Contributor Author

"test timeouts when expected" breaks now (does not look to be breaking on last commit in main). Looks like timeouts working, but console.log with bad message is still executed somehow

bun test v1.1.10-canary.1 (a0a71c22)

test-timeout.test.js:
error: Test "test timeouts when expected" timed out after 10ms
(fail) test timeouts when expected [68.13ms]
error: Test "test timeouts when expected 2" timed out after 10ms
(fail) test timeouts when expected 2 [66.73ms]
unreachable code
error: Test "process doesn't hang on test with ref'd value" timed out after 10ms
(fail) process doesn't hang on test with ref'd value [46.74ms]

 0 pass
 3 fail
Ran 3 tests across 1 files. [193.00ms]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Process is stuck after attempting to terminate already-exited worker
3 participants