Skip to content

test: use unique file names in fs trace test - #43504

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
bnoordhuis:fix43502
Jun 22, 2022
Merged

test: use unique file names in fs trace test#43504
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
bnoordhuis:fix43502

Conversation

@bnoordhuis

Copy link
Copy Markdown
Member

Should fix test flakiness that is presumably caused by the asynchronous
nature of the unlink operation on Windows.

It's been observed that sub-tests randomly fail with "permission denied"
errors when trying to create a new file in a directory with appropriate
permissions.

The DeleteFile() NT API call makes a file inaccessible and marks it for
deletion but doesn't actually delete it until the last open handle has
been closed. Accessing such a file fails with ERROR_ACCESS_DENIED.

Processes can close handles manually or wait for the operating system to
close them asynchronously after process termination. I speculate it's
the latter that's causing the test to turn flaky.

Fixes: #43502

Should fix test flakiness that is presumably caused by the asynchronous
nature of the unlink operation on Windows.
It's been observed that sub-tests randomly fail with "permission denied"
errors when trying to create a new file in a directory with appropriate
permissions.
The DeleteFile() NT API call makes a file inaccessible and marks it for
deletion but doesn't actually delete it until the last open handle has
been closed. Accessing such a file fails with ERROR_ACCESS_DENIED.
Processes can close handles manually or wait for the operating system to
close them asynchronously after process termination. I speculate it's
the latter that's causing the test to turn flaky.
Fixes: nodejs#43502
@nodejs-github-botnodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Jun 20, 2022
@F3n67u

Copy link
Copy Markdown
Contributor

@bnoordhuis Great work! Thank you for the fix.

@LiviaMedeirosLiviaMedeiros added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 20, 2022
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 20, 2022
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@LiviaMedeirosLiviaMedeiros left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

While we're at it, can const tests = new Array(); be replaced with const tests = {}; (sic!)?

@F3n67u

Copy link
Copy Markdown
Contributor

While we're at it, can const tests = new Array(); be replaced with const tests = {}; (sic!)?

Make sense to me. It is wired use Array as a object/Map.

@aduh95aduh95 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it make sense to use an incrementing variable in case we want to add/delete some test cases in the future?

@TrottTrott added the fast-track PRs that do not need to wait for 48 hours to land. label Jun 20, 2022
@github-actions

Copy link
Copy Markdown
Contributor

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

@lpincalpinca added the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 22, 2022
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 22, 2022
@nodejs-github-bot
nodejs-github-bot merged commit a7c9130 into nodejs:mainJun 22, 2022
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in a7c9130

targos pushed a commit that referenced this pull request Jul 12, 2022
Should fix test flakiness that is presumably caused by the asynchronous
nature of the unlink operation on Windows.
It's been observed that sub-tests randomly fail with "permission denied"
errors when trying to create a new file in a directory with appropriate
permissions.
The DeleteFile() NT API call makes a file inaccessible and marks it for
deletion but doesn't actually delete it until the last open handle has
been closed. Accessing such a file fails with ERROR_ACCESS_DENIED.
Processes can close handles manually or wait for the operating system to
close them asynchronously after process termination. I speculate it's
the latter that's causing the test to turn flaky.
Fixes: #43502
PR-URL: #43504
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@targostargos mentioned this pull request Jul 12, 2022
targos pushed a commit that referenced this pull request Jul 20, 2022
Should fix test flakiness that is presumably caused by the asynchronous
nature of the unlink operation on Windows.
It's been observed that sub-tests randomly fail with "permission denied"
errors when trying to create a new file in a directory with appropriate
permissions.
The DeleteFile() NT API call makes a file inaccessible and marks it for
deletion but doesn't actually delete it until the last open handle has
been closed. Accessing such a file fails with ERROR_ACCESS_DENIED.
Processes can close handles manually or wait for the operating system to
close them asynchronously after process termination. I speculate it's
the latter that's causing the test to turn flaky.
Fixes: #43502
PR-URL: #43504
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
targos pushed a commit that referenced this pull request Jul 31, 2022
Should fix test flakiness that is presumably caused by the asynchronous
nature of the unlink operation on Windows.
It's been observed that sub-tests randomly fail with "permission denied"
errors when trying to create a new file in a directory with appropriate
permissions.
The DeleteFile() NT API call makes a file inaccessible and marks it for
deletion but doesn't actually delete it until the last open handle has
been closed. Accessing such a file fails with ERROR_ACCESS_DENIED.
Processes can close handles manually or wait for the operating system to
close them asynchronously after process termination. I speculate it's
the latter that's causing the test to turn flaky.
Fixes: #43502
PR-URL: #43504
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@targostargos mentioned this pull request Aug 3, 2022
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
Should fix test flakiness that is presumably caused by the asynchronous
nature of the unlink operation on Windows.
It's been observed that sub-tests randomly fail with "permission denied"
errors when trying to create a new file in a directory with appropriate
permissions.
The DeleteFile() NT API call makes a file inaccessible and marks it for
deletion but doesn't actually delete it until the last open handle has
been closed. Accessing such a file fails with ERROR_ACCESS_DENIED.
Processes can close handles manually or wait for the operating system to
close them asynchronously after process termination. I speculate it's
the latter that's causing the test to turn flaky.
Fixes: nodejs/node#43502
PR-URL: nodejs/node#43504
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fast-trackPRs that do not need to wait for 48 hours to land.needs-ciPRs that need a full CI run.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate flaky test-trace-events-fs-sync

9 participants

@bnoordhuis@F3n67u@nodejs-github-bot@Trott@benjamingr@lpinca@richardlau@aduh95@LiviaMedeiros