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

test: fix test-child-process-fork-net #51841

Closed
wants to merge 3 commits into from

Conversation

joyeecheung
Copy link
Member

@joyeecheung joyeecheung commented Feb 23, 2024

The child processes are supposed to get 4 messages (2 ends, 2 writes). Previously the mustCall() wrapping the message listener attempts to match exactly 1 invocation which is bound to fail but could be swallowed if the child happens to be killed before the exit event is fired for the mustCall() check to work. In the CI, on some machines the kill() could happen after the child process finishes with the mustCall() check, resulting in EPERM errors in kill().

This patch fixes the mustCall() checks (updating the expected invocation count to 4) and swallow the errors when kill() fails, which should be fine because they are only there for cleanup.

Refs: #51813

The child processes are supposed to get 4 messages (2 ends, 2 writes).
Previously the mustCall() wrapping the message listener attempts
to match exactly 1 invocation which is bound to fail but could be
swallowed if the child happens to be killed before the exit event
is fired for the mustCall() check to work. In the CI, on some
machines the kill() could happen after the child process finishes
with the mustCall() check, resulting in EPERM errors in kill().

This patch fixes the mustCall() checks (updating the expected
invocation count to 4) and swallow the errors when kill() fails,
which should be fine because they are only there for cleanup.
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Feb 23, 2024
@joyeecheung joyeecheung added the request-ci Add this label to start a Jenkins CI on a PR. label Feb 23, 2024
@joyeecheung
Copy link
Member Author

Trying to start a few Windows stress tests.. https://ci.nodejs.org/view/Stress/job/node-stress-single-test/471/

@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Feb 23, 2024
@nodejs-github-bot
Copy link
Collaborator

@targos targos added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 23, 2024
@joyeecheung
Copy link
Member Author

Stress test and the CI are happy.

test/parallel/test-child-process-fork-net.js Outdated Show resolved Hide resolved
@joyeecheung joyeecheung added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Feb 23, 2024
@joyeecheung joyeecheung added the request-ci Add this label to start a Jenkins CI on a PR. label Feb 23, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Feb 23, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Feb 25, 2024
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/51841
✔  Done loading data for nodejs/node/pull/51841
----------------------------------- PR info ------------------------------------
Title      test: fix test-child-process-fork-net (#51841)
Author     Joyee Cheung  (@joyeecheung)
Branch     joyeecheung:child-process-fork-net -> nodejs:main
Labels     test, author ready, needs-ci, commit-queue-squash
Commits    3
 - test: fix test-child-process-fork-net
 - fixup! test: fix test-child-process-fork-net
 - fixup! fixup! test: fix test-child-process-fork-net
Committers 1
 - Joyee Cheung 
PR-URL: https://github.com/nodejs/node/pull/51841
Refs: https://github.com/nodejs/node/issues/51813
Reviewed-By: Michaël Zasso 
Reviewed-By: Antoine du Hamel 
Reviewed-By: Luigi Pinca 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/51841
Refs: https://github.com/nodejs/node/issues/51813
Reviewed-By: Michaël Zasso 
Reviewed-By: Antoine du Hamel 
Reviewed-By: Luigi Pinca 
--------------------------------------------------------------------------------
   ⚠  Commits were pushed since the last approving review:
   ⚠  - fixup! fixup! test: fix test-child-process-fork-net
   ℹ  This PR was created on Fri, 23 Feb 2024 01:24:20 GMT
   ✔  Approvals: 3
   ✔  - Michaël Zasso (@targos) (TSC): https://github.com/nodejs/node/pull/51841#pullrequestreview-1898209954
   ✔  - Antoine du Hamel (@aduh95) (TSC): https://github.com/nodejs/node/pull/51841#pullrequestreview-1898621909
   ✔  - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/51841#pullrequestreview-1898626128
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2024-02-24T11:31:19Z: https://ci.nodejs.org/job/node-test-pull-request/57386/
- Querying data for job/node-test-pull-request/57386/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/8034695926

joyeecheung added a commit that referenced this pull request Feb 25, 2024
The child processes are supposed to get 4 messages (2 ends, 2 writes).
Previously the mustCall() wrapping the message listener attempts
to match exactly 1 invocation which is bound to fail but could be
swallowed if the child happens to be killed before the exit event
is fired for the mustCall() check to work. In the CI, on some
machines the kill() could happen after the child process finishes
with the mustCall() check, resulting in EPERM errors in kill().

This patch fixes the mustCall() checks (updating the expected
invocation count to 4) and swallow the errors when kill() fails,
which should be fine because they are only there for cleanup.

PR-URL: #51841
Refs: #51813
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@joyeecheung
Copy link
Member Author

Landed in ec7a268

marco-ippolito pushed a commit that referenced this pull request Feb 26, 2024
The child processes are supposed to get 4 messages (2 ends, 2 writes).
Previously the mustCall() wrapping the message listener attempts
to match exactly 1 invocation which is bound to fail but could be
swallowed if the child happens to be killed before the exit event
is fired for the mustCall() check to work. In the CI, on some
machines the kill() could happen after the child process finishes
with the mustCall() check, resulting in EPERM errors in kill().

This patch fixes the mustCall() checks (updating the expected
invocation count to 4) and swallow the errors when kill() fails,
which should be fine because they are only there for cleanup.

PR-URL: #51841
Refs: #51813
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
marco-ippolito pushed a commit that referenced this pull request Feb 26, 2024
The child processes are supposed to get 4 messages (2 ends, 2 writes).
Previously the mustCall() wrapping the message listener attempts
to match exactly 1 invocation which is bound to fail but could be
swallowed if the child happens to be killed before the exit event
is fired for the mustCall() check to work. In the CI, on some
machines the kill() could happen after the child process finishes
with the mustCall() check, resulting in EPERM errors in kill().

This patch fixes the mustCall() checks (updating the expected
invocation count to 4) and swallow the errors when kill() fails,
which should be fine because they are only there for cleanup.

PR-URL: #51841
Refs: #51813
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
marco-ippolito pushed a commit that referenced this pull request Feb 27, 2024
The child processes are supposed to get 4 messages (2 ends, 2 writes).
Previously the mustCall() wrapping the message listener attempts
to match exactly 1 invocation which is bound to fail but could be
swallowed if the child happens to be killed before the exit event
is fired for the mustCall() check to work. In the CI, on some
machines the kill() could happen after the child process finishes
with the mustCall() check, resulting in EPERM errors in kill().

This patch fixes the mustCall() checks (updating the expected
invocation count to 4) and swallow the errors when kill() fails,
which should be fine because they are only there for cleanup.

PR-URL: #51841
Refs: #51813
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@marco-ippolito marco-ippolito mentioned this pull request Mar 1, 2024
richardlau pushed a commit that referenced this pull request Mar 25, 2024
The child processes are supposed to get 4 messages (2 ends, 2 writes).
Previously the mustCall() wrapping the message listener attempts
to match exactly 1 invocation which is bound to fail but could be
swallowed if the child happens to be killed before the exit event
is fired for the mustCall() check to work. In the CI, on some
machines the kill() could happen after the child process finishes
with the mustCall() check, resulting in EPERM errors in kill().

This patch fixes the mustCall() checks (updating the expected
invocation count to 4) and swallow the errors when kill() fails,
which should be fine because they are only there for cleanup.

PR-URL: #51841
Refs: #51813
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
richardlau pushed a commit that referenced this pull request Mar 25, 2024
The child processes are supposed to get 4 messages (2 ends, 2 writes).
Previously the mustCall() wrapping the message listener attempts
to match exactly 1 invocation which is bound to fail but could be
swallowed if the child happens to be killed before the exit event
is fired for the mustCall() check to work. In the CI, on some
machines the kill() could happen after the child process finishes
with the mustCall() check, resulting in EPERM errors in kill().

This patch fixes the mustCall() checks (updating the expected
invocation count to 4) and swallow the errors when kill() fails,
which should be fine because they are only there for cleanup.

PR-URL: #51841
Refs: #51813
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@richardlau richardlau mentioned this pull request Mar 25, 2024
rdw-msft pushed a commit to rdw-msft/node that referenced this pull request Mar 26, 2024
The child processes are supposed to get 4 messages (2 ends, 2 writes).
Previously the mustCall() wrapping the message listener attempts
to match exactly 1 invocation which is bound to fail but could be
swallowed if the child happens to be killed before the exit event
is fired for the mustCall() check to work. In the CI, on some
machines the kill() could happen after the child process finishes
with the mustCall() check, resulting in EPERM errors in kill().

This patch fixes the mustCall() checks (updating the expected
invocation count to 4) and swallow the errors when kill() fails,
which should be fine because they are only there for cleanup.

PR-URL: nodejs#51841
Refs: nodejs#51813
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-failed An error occurred while landing this pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants