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

test: don't need to remove nonexistent directories(test-fs-mkdir.js) by ah-yu · Pull Request #17119 · nodejs/node · GitHub

/ node Public

test: don't need to remove nonexistent directories(test-fs-mkdir.js) - #17119

Closed
ah-yu wants to merge 2 commits into
nodejs:masterfrom
ah-yu:test-fs-mkdir-fix
Closed

test: don't need to remove nonexistent directories(test-fs-mkdir.js)#17119
ah-yu wants to merge 2 commits into
nodejs:masterfrom
ah-yu:test-fs-mkdir-fix

Conversation

ah-yu commented Nov 18, 2017

Copy link
Copy Markdown
Contributor

the tempdir is empty , so tempdir/test1 and tempdir/test2 are nonexistent. we don't need to delete nonexistent directories.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

test

the TempDirection is empty , so tempdir/test1 and tempdir/test2 are nonexistent. we dont need to delete nonexistent directories.
nodejs-github-bot added the test Issues and PRs related to the tests. label Nov 18, 2017

mscdex commented Nov 18, 2017
edited
Loading

Copy link
Copy Markdown
Contributor

Those statements are probably there in case this test fails an assertion and a directory gets left behind as a result. I would prefer to keep those statements there.

mscdex added the fs Issues and PRs related to the fs subsystem / file system. label Nov 18, 2017

ah-yu commented Nov 19, 2017

Copy link
Copy Markdown
Contributor Author

@mscdex Hi, thanks for review. unlink(pathname) is invoked before fs.mkdir(), so these statement can't guarantee there is no directory left. process.on('exit', function() unlink(pathname);}); these code will delete directories that made in this test whether the test passes or fails

Trott commented Nov 19, 2017

Copy link
Copy Markdown
Member

Those statements are probably there in case this test fails an assertion and a directory gets left behind as a result. I would prefer to keep those statements there.

common.refreshTmpDir() should guarantee that the tmp directory is empty before any of the test cases run. Each test case uses a unique file name so these unlink() statements should be safe to remove.

It's conceivable that future changes to the test will re-use pathnames. I'm not sure it's worth guarding against though.

There is certainly no need to clean up the directories after the fact. @buji1993 Can you remove the process.on('exit',...) stuff and the unlink(pathname) on line 69 in your PR (line 73 in the original)?

ah-yu commented Nov 20, 2017

Copy link
Copy Markdown
Contributor Author

@Trott yeah, I will remove that. Thanks for review

Trott 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM if CI passes

Trott commented Nov 21, 2017

Copy link
Copy Markdown
Member

joyeecheung added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Nov 21, 2017
jasnell pushed a commit that referenced this pull request Nov 22, 2017
the TempDirection is empty , so tempdir/test1 and tempdir/test2
are nonexistent. we dont need to delete nonexistent directories.

PR-URL: #17119
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
jasnell pushed a commit that referenced this pull request Nov 22, 2017
PR-URL: #17119
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>

jasnell commented Nov 22, 2017

Copy link
Copy Markdown
Member

Landed in fdbee33 and b28a28a

jasnell closed this Nov 22, 2017
addaleax removed the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Nov 28, 2017
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
the TempDirection is empty , so tempdir/test1 and tempdir/test2
are nonexistent. we dont need to delete nonexistent directories.

PR-URL: #17119
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
PR-URL: #17119
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
the TempDirection is empty , so tempdir/test1 and tempdir/test2
are nonexistent. we dont need to delete nonexistent directories.

PR-URL: #17119
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
PR-URL: #17119
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
MylesBorins mentioned this pull request Dec 12, 2017
gibfahn pushed a commit that referenced this pull request Dec 19, 2017
the TempDirection is empty , so tempdir/test1 and tempdir/test2
are nonexistent. we dont need to delete nonexistent directories.

PR-URL: #17119
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
gibfahn pushed a commit that referenced this pull request Dec 19, 2017
PR-URL: #17119
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 19, 2017
the TempDirection is empty , so tempdir/test1 and tempdir/test2
are nonexistent. we dont need to delete nonexistent directories.

PR-URL: #17119
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 19, 2017
PR-URL: #17119
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
gibfahn mentioned this pull request Dec 20, 2017
gibfahn pushed a commit that referenced this pull request Dec 20, 2017
the TempDirection is empty , so tempdir/test1 and tempdir/test2
are nonexistent. we dont need to delete nonexistent directories.

PR-URL: #17119
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
gibfahn pushed a commit that referenced this pull request Dec 20, 2017
PR-URL: #17119
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
gibfahn mentioned this pull request Dec 20, 2017
MylesBorins mentioned this pull request Dec 20, 2017
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

fs Issues and PRs related to the fs subsystem / file system. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.


Back | FazBrowse Home | New Git URL