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 writefile with fd #38820

Closed
wants to merge 2 commits into from

Conversation

Linkgoron
Copy link
Member

@Linkgoron Linkgoron commented May 26, 2021

Fix writefile with fd so that it'll close the fds that it uses during the test, as it breaks the build on Windows, after #38684

fix writefile with fd so that it'll close the fds
that is uses during the test.
@github-actions github-actions bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels May 26, 2021
@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@richardlau richardlau left a comment

Choose a reason for hiding this comment

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

Would it be more "correct" to wrap the expected-to-fail writeFile() calls in a try-finally block and close the fd in the finally block?

@Linkgoron
Copy link
Member Author

Linkgoron commented May 26, 2021

Would it be more "correct" to wrap the expected-to-fail writeFile() calls in a try-finally block and close the fd in the finally block?

What I did was definitely wrong for the sync write, as if one of those asserts fails I would miss registering the beforeExit.

For the other paths - I think that its simpler to push the fds into an array, because everything is async and I would need to make sure that all of the paths are covered.

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented May 26, 2021

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented May 27, 2021

@Linkgoron Linkgoron added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 27, 2021
@targos targos added the fast-track PRs that do not need to wait for 48 hours to land. label May 28, 2021
@github-actions
Copy link
Contributor

Fast-track has been requested by @targos. Please 👍 to approve.

targos pushed a commit that referenced this pull request May 28, 2021
fix writefile with fd so that it'll close the fds
that is uses during the test.

PR-URL: #38820
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
@targos
Copy link
Member

targos commented May 28, 2021

Landed in 0222a10

@targos targos closed this May 28, 2021
danielleadams pushed a commit that referenced this pull request May 31, 2021
fix writefile with fd so that it'll close the fds
that is uses during the test.

PR-URL: #38820
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
@danielleadams danielleadams mentioned this pull request May 31, 2021
richardlau pushed a commit that referenced this pull request Jul 16, 2021
fix writefile with fd so that it'll close the fds
that is uses during the test.

PR-URL: #38820
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
richardlau pushed a commit that referenced this pull request Jul 19, 2021
fix writefile with fd so that it'll close the fds
that is uses during the test.

PR-URL: #38820
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
richardlau pushed a commit that referenced this pull request Jul 20, 2021
fix writefile with fd so that it'll close the fds
that is uses during the test.

PR-URL: #38820
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
@richardlau richardlau mentioned this pull request Jul 20, 2021
foxxyz pushed a commit to foxxyz/node that referenced this pull request Oct 18, 2021
fix writefile with fd so that it'll close the fds
that is uses during the test.

PR-URL: nodejs#38820
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Darshan Sen <raisinten@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. fast-track PRs that do not need to wait for 48 hours to land. 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.

6 participants