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: don't need to remove nonexistent directories(test-fs-mkdir.js) #17119

Closed
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
@ah-yu
Contributor

ah-yu commented Nov 18, 2017

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

test: dont need to remove nonexistent directory(test-fs-mkdir.js)
the TempDirection is empty , so tempdir/test1 and tempdir/test2 are nonexistent. we dont need to delete nonexistent directories.
@mscdex

This comment has been minimized.

Show comment
Hide comment
@mscdex

mscdex Nov 18, 2017

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.

Contributor

mscdex commented Nov 18, 2017

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 mscdex added the fs label Nov 18, 2017

@ah-yu

This comment has been minimized.

Show comment
Hide comment
@ah-yu

ah-yu Nov 19, 2017

Contributor

@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

Contributor

ah-yu commented Nov 19, 2017

@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

This comment has been minimized.

Show comment
Hide comment
@Trott

Trott Nov 19, 2017

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)?

Member

Trott commented Nov 19, 2017

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

This comment has been minimized.

Show comment
Hide comment
@ah-yu

ah-yu Nov 20, 2017

Contributor

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

Contributor

ah-yu commented Nov 20, 2017

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

@Trott

Trott approved these changes Nov 21, 2017

LGTM if CI passes

@danbev

danbev approved these changes Nov 21, 2017

@Trott

This comment has been minimized.

Show comment
Hide comment

jasnell added a commit that referenced this pull request Nov 22, 2017

test: dont need to remove nonexistent directory
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 added a commit that referenced this pull request Nov 22, 2017

test: remove unlink function which is needless
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

This comment has been minimized.

Show comment
Hide comment
@jasnell

jasnell Nov 22, 2017

Member

Landed in fdbee33 and b28a28a

Member

jasnell commented Nov 22, 2017

Landed in fdbee33 and b28a28a

@jasnell jasnell closed this Nov 22, 2017

@addaleax addaleax removed the author ready label Nov 28, 2017

MylesBorins added a commit that referenced this pull request Dec 12, 2017

test: dont need to remove nonexistent directory
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 added a commit that referenced this pull request Dec 12, 2017

test: remove unlink function which is needless
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 added a commit that referenced this pull request Dec 12, 2017

test: dont need to remove nonexistent directory
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 added a commit that referenced this pull request Dec 12, 2017

test: remove unlink function which is needless
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 MylesBorins referenced this pull request Dec 12, 2017

Merged

v9.3.0 proposal #17631

gibfahn added a commit that referenced this pull request Dec 19, 2017

test: dont need to remove nonexistent directory
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 added a commit that referenced this pull request Dec 19, 2017

test: remove unlink function which is needless
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 added a commit that referenced this pull request Dec 19, 2017

test: dont need to remove nonexistent directory
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 added a commit that referenced this pull request Dec 19, 2017

test: remove unlink function which is needless
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 gibfahn referenced this pull request Dec 20, 2017

Closed

v8.9.4 proposal #17772

gibfahn added a commit that referenced this pull request Dec 20, 2017

test: dont need to remove nonexistent directory
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 added a commit that referenced this pull request Dec 20, 2017

test: remove unlink function which is needless
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 gibfahn referenced this pull request Dec 20, 2017

Merged

v8.9.4 proposal #17774

@MylesBorins MylesBorins referenced this pull request Dec 20, 2017

Merged

v6.12.3 proposal #17776

msoechting added a commit to hpicgs/node that referenced this pull request Feb 5, 2018

test: dont need to remove nonexistent directory
the TempDirection is empty , so tempdir/test1 and tempdir/test2
are nonexistent. we dont need to delete nonexistent directories.

PR-URL: nodejs#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>

msoechting added a commit to hpicgs/node that referenced this pull request Feb 5, 2018

test: remove unlink function which is needless
PR-URL: nodejs#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>

msoechting added a commit to hpicgs/node that referenced this pull request Feb 7, 2018

test: dont need to remove nonexistent directory
the TempDirection is empty , so tempdir/test1 and tempdir/test2
are nonexistent. we dont need to delete nonexistent directories.

PR-URL: nodejs#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>

msoechting added a commit to hpicgs/node that referenced this pull request Feb 7, 2018

test: remove unlink function which is needless
PR-URL: nodejs#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment