Skip to content
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

fix: cleanup after pages dev tests #678

Merged
merged 1 commit into from
Mar 23, 2022
Merged

Conversation

threepointone
Copy link
Contributor

@threepointone threepointone commented Mar 23, 2022

We weren't killing the process started by wrangler whenever its parent was killed. This fix is to listen on SIGINT/SIGTERM and kill that process. I also did some minor configuration cleanups.

Fixes #397
Fixes #618


(fyi this does NOT cleanup the occasional flake with the remix test where the text doesn't render)

@changeset-bot
Copy link

changeset-bot bot commented Mar 23, 2022

🦋 Changeset detected

Latest commit: 2549799

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wrangler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Mar 23, 2022

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/2027536893/npm-package-wrangler-678

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/678/npm-package-wrangler-678

Or you can use npx with this latest build directly:

npx https://prerelease-registry.developers.workers.dev/runs/2027536893/npm-package-wrangler-678 dev path/to/script.js

console.log(chunk.toString());
});
});

afterAll(() => {
wranglerProcess.kill();
afterAll(async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could probably clean this up by using execa here, but I'll leave that for some other time/person

@threepointone
Copy link
Contributor Author

oh lol this hangs on windows and ubuntu huh

@threepointone threepointone marked this pull request as draft March 23, 2022 09:20
@threepointone threepointone changed the title fix: cleanup after pages dev tests WIP fix: cleanup after pages dev tests Mar 23, 2022
@threepointone threepointone changed the title WIP fix: cleanup after pages dev tests fix: cleanup after pages dev tests Mar 23, 2022
@threepointone
Copy link
Contributor Author

Aight, looks like forceExit is still necessary for windows/ubuntu.

@threepointone threepointone marked this pull request as ready for review March 23, 2022 09:24
@threepointone threepointone force-pushed the cleanup-pages-dev-tests branch 2 times, most recently from c2f0c6c to 1ee1c91 Compare March 23, 2022 09:32
We weren't killing the process started by wrangler whenever its parent was killed. This fix is to listen on SIGINT/SIGTERM and kill that process. I also did some minor configuration cleanups.

Fixes #397
Fixes #618
@@ -27,6 +27,7 @@ const EXIT = (message?: string, code?: number) => {
if (message) console.log(message);
if (code) process.exitCode = code;
EXIT_CALLBACKS.forEach((callback) => callback());
RUNNING_BUILDERS.forEach((builder) => builder.stop?.());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cleans up hanging esbuild processes

Copy link
Member

@GregBrimble GregBrimble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, thought we'd got it yesterday! Let's see if this does it now.

@threepointone threepointone merged commit 82e4143 into main Mar 23, 2022
@threepointone threepointone deleted the cleanup-pages-dev-tests branch March 23, 2022 11:37
@threepointone
Copy link
Contributor Author

🤞

@github-actions github-actions bot mentioned this pull request Mar 23, 2022
mrbbot added a commit that referenced this pull request Oct 31, 2023
With #656, the Queues dispatcher is now implemented as part of the
broker Durable Object. We no longer send message batches directly
from Node.js, so can remove queue handling from the entry worker.

Note the magic proxy enqueues messages through queue producer
bindings like regular workers, so never used this endpoint directly.
mrbbot added a commit that referenced this pull request Nov 1, 2023
With #656, the Queues dispatcher is now implemented as part of the
broker Durable Object. We no longer send message batches directly
from Node.js, so can remove queue handling from the entry worker.

Note the magic proxy enqueues messages through queue producer
bindings like regular workers, so never used this endpoint directly.
mrbbot added a commit that referenced this pull request Nov 1, 2023
With #656, the Queues dispatcher is now implemented as part of the
broker Durable Object. We no longer send message batches directly
from Node.js, so can remove queue handling from the entry worker.

Note the magic proxy enqueues messages through queue producer
bindings like regular workers, so never used this endpoint directly.
mrbbot added a commit that referenced this pull request Nov 1, 2023
With #656, the Queues dispatcher is now implemented as part of the
broker Durable Object. We no longer send message batches directly
from Node.js, so can remove queue handling from the entry worker.

Note the magic proxy enqueues messages through queue producer
bindings like regular workers, so never used this endpoint directly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants