FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: add test for reused AbortController with execfile() by Trott · Pull Request #36644 · nodejs/node · GitHub

/ node Public

test: add test for reused AbortController with execfile() - #36644

Merged
Trott merged 4 commits into
nodejs:masterfrom
Trott:reused-ac
Dec 30, 2020
Merged

test: add test for reused AbortController with execfile()#36644
Trott merged 4 commits into
nodejs:masterfrom
Trott:reused-ac

Conversation

Trott commented Dec 27, 2020

Copy link
Copy Markdown
Member

Test that reusing an aborted AbortController with execfile() results in
immediate SIGTERM.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

nodejs-github-bot added the test Issues and PRs related to the tests. label Dec 27, 2020

Trott commented Dec 27, 2020

Copy link
Copy Markdown
Member Author

@benjamingr Is the behavior seen here as expected?

Trott requested a review from benjamingr December 27, 2020 17:46
Trott added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 27, 2020
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 27, 2020

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Member

github makes the PR very hard to read - but the behaviour seems correct yes :]

Trott commented Dec 27, 2020

Copy link
Copy Markdown
Member Author

github makes the PR very hard to read - but the behaviour seems correct yes :]

Should be easier to read now that I've removed the lint errors. Whoops!

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Member

What do you think about the behaviour? I think an AbortError might be nicer to users? Not sure

Trott commented Dec 28, 2020

Copy link
Copy Markdown
Member Author

What do you think about the behaviour? I think an AbortError might be nicer to users? Not sure

That's what I was expecting, but I'm not familiar with the spec or general usage TBH.

Copy link
Copy Markdown
Member

That's what I was expecting, but I'm not familiar with the spec or general usage TBH.

I think that makes more sense yeah - want to fix the code to reject with that? Should be pretty straightforward.

(If you don't feel like it lmk and I'll make a separate PR or push another commit to this one whatever you prefer)

Trott commented Dec 28, 2020

Copy link
Copy Markdown
Member Author

The other possible reasonable-seeming options are:

  • throw an error if the AbortController is already in an aborted state when execfile() is called
  • ignore an AbortController that is already in an aborted state when execfile() is called

Are we (you, I guess) sure those aren't better options?

Copy link
Copy Markdown
Member

throw an error if the AbortController is already in an aborted state when execfile() is called

That sounds like the preferable alternative to me.

Trott commented Dec 28, 2020

Copy link
Copy Markdown
Member Author

throw an error if the AbortController is already in an aborted state when execfile() is called

That sounds like the preferable alternative to me.

Would it be appropriate to Do Whatever Fetch Does In That SItuation?

Copy link
Copy Markdown
Member

Would it be appropriate to Do Whatever Fetch Does In That SItuation?

const ac = new AbortController();
const { signal } = ac;
ac.abort();
fetch('./', { signal }).catch(() => {});
fetch('./', { signal }).catch(console.log); // Logs an AbortError

AbortError it is I think

Trott commented Dec 29, 2020

Copy link
Copy Markdown
Member Author

AbortError it is I think

OK, done! Guess I better go and check the behavior of everything else that uses AbortController in child_process for consistency.

Comment thread lib/child_process.js Outdated
Trott added the child_process Issues and PRs related to the child_process subsystem. label Dec 29, 2020

Trott commented Dec 29, 2020

Copy link
Copy Markdown
Member Author

OK, I think this is ready for review.

Trott added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 29, 2020
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 29, 2020

Copy link
Copy Markdown
Collaborator

benjamingr added request-ci Add this label to start a Jenkins CI on a PR. commit-queue Add this label to land a pull request using GitHub Actions. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Dec 30, 2020
Test that reusing an aborted AbortController with execfile() results in
immediate SIGTERM.

PR-URL: nodejs#36644
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
If an AbortController passed to execfile() is already aborted, use the
same behavior as if the controller was aborted after calling execfile().
This mimics the behavior of fetch in the browser.

PR-URL: nodejs#36644
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Move duplicate abort handler logic into a separate function.

PR-URL: nodejs#36644
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
PR-URL: nodejs#36644
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>

Trott commented Dec 30, 2020

Copy link
Copy Markdown
Member Author

Landed in faee739...37acaf6

Trott removed the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 30, 2020
Trott merged commit 37acaf6 into nodejs:master Dec 30, 2020
Trott deleted the reused-ac branch December 30, 2020 15:55

Copy link
Copy Markdown
Member

I didn't realize the GitHub labels automated Rich 😮

danielleadams pushed a commit that referenced this pull request Jan 12, 2021
Test that reusing an aborted AbortController with execfile() results in
immediate SIGTERM.

PR-URL: #36644
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
danielleadams pushed a commit that referenced this pull request Jan 12, 2021
If an AbortController passed to execfile() is already aborted, use the
same behavior as if the controller was aborted after calling execfile().
This mimics the behavior of fetch in the browser.

PR-URL: #36644
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
danielleadams pushed a commit that referenced this pull request Jan 12, 2021
Move duplicate abort handler logic into a separate function.

PR-URL: #36644
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
danielleadams pushed a commit that referenced this pull request Jan 12, 2021
PR-URL: #36644
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
danielleadams mentioned this pull request Jan 12, 2021
targos pushed a commit that referenced this pull request May 25, 2021
Test that reusing an aborted AbortController with execfile() results in
immediate SIGTERM.

PR-URL: #36644
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
targos pushed a commit that referenced this pull request May 25, 2021
If an AbortController passed to execfile() is already aborted, use the
same behavior as if the controller was aborted after calling execfile().
This mimics the behavior of fetch in the browser.

PR-URL: #36644
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
targos pushed a commit that referenced this pull request May 25, 2021
Move duplicate abort handler logic into a separate function.

PR-URL: #36644
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
targos pushed a commit that referenced this pull request May 25, 2021
PR-URL: #36644
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
targos pushed a commit that referenced this pull request Jun 5, 2021
Test that reusing an aborted AbortController with execfile() results in
immediate SIGTERM.

PR-URL: #36644
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
targos pushed a commit that referenced this pull request Jun 5, 2021
If an AbortController passed to execfile() is already aborted, use the
same behavior as if the controller was aborted after calling execfile().
This mimics the behavior of fetch in the browser.

PR-URL: #36644
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
targos pushed a commit that referenced this pull request Jun 5, 2021
Move duplicate abort handler logic into a separate function.

PR-URL: #36644
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
targos pushed a commit that referenced this pull request Jun 5, 2021
PR-URL: #36644
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
targos pushed a commit that referenced this pull request Jun 11, 2021
Test that reusing an aborted AbortController with execfile() results in
immediate SIGTERM.

PR-URL: #36644
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
targos pushed a commit that referenced this pull request Jun 11, 2021
If an AbortController passed to execfile() is already aborted, use the
same behavior as if the controller was aborted after calling execfile().
This mimics the behavior of fetch in the browser.

PR-URL: #36644
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
targos pushed a commit that referenced this pull request Jun 11, 2021
Move duplicate abort handler logic into a separate function.

PR-URL: #36644
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
targos pushed a commit that referenced this pull request Jun 11, 2021
PR-URL: #36644
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

child_process Issues and PRs related to the child_process subsystem. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL