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: update killProc to retry unsupported taskkill operations with the alternative kill method #26

Merged
merged 2 commits into from
Jan 2, 2024
Merged

Conversation

Waldeedle
Copy link
Contributor

What:
Retrying to kill a process when treeKill returns an error with the reason: the operation attempted is not supported.

Why:
This error was encountered with windows systems, when using the exec function on a child process.
The CI pipeline would sometimes encounter this error (flaky testing).
/claim #3

How:

  • update killProc function to use the existing retry logic when the error returned is specifically the unsupported taskkill operations error
  • update killProc function to resolve when the error returned states that the process has no running instances rather than use the retry logic

Checklist:

  • Tests "N/A"
  • TypeScript definitions updated "N/A"
  • [ x ] Ready to be merged

Copy link

algora-pbc bot commented Jan 1, 2024

💵 To receive payouts, sign up on Algora, link your Github account and connect with Stripe/Alipay.

@Waldeedle
Copy link
Contributor Author

https://github.com/Waldeedle/plop/actions/runs/7380439467/job/20077807529 - got a pipeline working here.
Made a simple replace step to add my solution after it copies down the dependencies to overwrite the esm.js file.
Feel free to run it a few times for a sanity check.

@crutchcorn
Copy link
Owner

Looking good so far!

I'm reviewing this PR as a branch on Plop main. On 5 successful CI passes, I'll merge and award the payout! :D

Thanks for this!

plopjs/plop#412

@crutchcorn
Copy link
Owner

Upon a couple of runs, there appears to be some kind of issue with stdout reading on Windows runs (ran into with both Plop and this repo).

However, that's unrelated to the killProc issue as outlined by the bounty, and it's immensely clear that our tests are now drastically less flakey.

@crutchcorn crutchcorn merged commit eb11d55 into crutchcorn:main Jan 2, 2024
7 checks passed
Copy link

github-actions bot commented Jan 2, 2024

🎉 This PR is included in version 2.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Waldeedle
Copy link
Contributor Author

Just for context I noticed some flakiness in ubuntu as well when running the tests (not related to killProc).
I'll try to gather some more info around what specifically failed since I saw it locally before.
Thanks for tweeting about this, was fun to just dig into something outside of my own bugs for once 😉

@Waldeedle Waldeedle deleted the pr/fix-windows-killproc branch January 2, 2024 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants