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: fs.link() test runs on same device #4861

Closed
wants to merge 2 commits into from

Conversation

Projects
None yet
5 participants
@drewfish
Copy link
Contributor

commented Jan 25, 2016

When running the tests if NODE_TEST_DIR is set to a device different
than the location of the test files (where this repo is checked out),
then the parallel/test-fs-link.js test will fail with
EXDEV: cross-device link not permitted. The code works fine (and is in
fact throwing an error as desired) but the test fails.

This commit first copies the "source" file to the same directory as the
"destination" (where the hardlink will be created).

test: fs.link() test runs on same device
When running the tests if `NODE_TEST_DIR` is set to a device different
than the location of the test files (where this repo is checked out),
then the parallel/test-fs-link.js test will fail with
`EXDEV: cross-device link not permitted`. The code works fine (and is in
fact throwing an error as desired) but the test fails.

This commit first copies the "source" file to the same directory as the
"destination" (where the hardlink will be created).

@mscdex mscdex added fs test labels Jan 25, 2016

@drewfish

This comment has been minimized.

Copy link
Contributor Author

commented Jan 25, 2016

This PR possibly replaces PR #4859 (which is made against the v4.x branch).

@drewfish

This comment has been minimized.

Copy link
Contributor Author

commented Jan 25, 2016

I'm particularly interested in having this backported to the v4.x branch if that makes sense, as I'm running into the test failure while trying to build argon.

@@ -8,15 +8,19 @@ common.refreshTmpDir();

// test creating and reading hard link
const srcPath = path.join(common.fixturesDir, 'cycles', 'root.js');
const srcContent = fs.readFileSync(srcPath, 'utf8');
const tmpSrcPath = path.join(common.tmpDir, 'root.js');

This comment has been minimized.

Copy link
@bnoordhuis

bnoordhuis Jan 25, 2016

Member

I'd simplify this to e.g.:

const srcPath = path.join(common.tmpDir, 'target.txt');
fs.writeFileSync(srcPath, 'hello world');

One fewer variable.

@drewfish

This comment has been minimized.

Copy link
Contributor Author

commented Jan 25, 2016

updated

@Trott

This comment has been minimized.

Copy link
Member

commented Jan 25, 2016

bnoordhuis added a commit that referenced this pull request Jan 26, 2016

test: fs.link() test runs on same device
When running the tests if `NODE_TEST_DIR` is set to a device different
than the location of the test files (where this repo is checked out),
then the parallel/test-fs-link.js test will fail with
`EXDEV: cross-device link not permitted`. The code works fine (and is in
fact throwing an error as desired) but the test fails.

This commit first creates the "source" file in the same directory as the
"destination" (where the hardlink will be created).

PR-URL: #4861
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@bnoordhuis

This comment has been minimized.

Copy link
Member

commented Jan 26, 2016

CI is green. Landed in 9b1bc1d with a slightly amended commit log ("created", not "copied"). Thanks!

@bnoordhuis bnoordhuis closed this Jan 26, 2016

@drewfish drewfish deleted the drewfish:test-hardlink-same-device branch Jan 26, 2016

rvagg added a commit that referenced this pull request Jan 27, 2016

test: fs.link() test runs on same device
When running the tests if `NODE_TEST_DIR` is set to a device different
than the location of the test files (where this repo is checked out),
then the parallel/test-fs-link.js test will fail with
`EXDEV: cross-device link not permitted`. The code works fine (and is in
fact throwing an error as desired) but the test fails.

This commit first creates the "source" file in the same directory as the
"destination" (where the hardlink will be created).

PR-URL: #4861
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>

benjamingr added a commit to benjamingr/io.js that referenced this pull request Jan 27, 2016

test: fs.link() test runs on same device
When running the tests if `NODE_TEST_DIR` is set to a device different
than the location of the test files (where this repo is checked out),
then the parallel/test-fs-link.js test will fail with
`EXDEV: cross-device link not permitted`. The code works fine (and is in
fact throwing an error as desired) but the test fails.

This commit first creates the "source" file in the same directory as the
"destination" (where the hardlink will be created).

PR-URL: nodejs#4861
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>

rvagg added a commit that referenced this pull request Feb 8, 2016

test: fs.link() test runs on same device
When running the tests if `NODE_TEST_DIR` is set to a device different
than the location of the test files (where this repo is checked out),
then the parallel/test-fs-link.js test will fail with
`EXDEV: cross-device link not permitted`. The code works fine (and is in
fact throwing an error as desired) but the test fails.

This commit first creates the "source" file in the same directory as the
"destination" (where the hardlink will be created).

PR-URL: #4861
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>

MylesBorins added a commit that referenced this pull request Feb 17, 2016

test: fs.link() test runs on same device
When running the tests if `NODE_TEST_DIR` is set to a device different
than the location of the test files (where this repo is checked out),
then the parallel/test-fs-link.js test will fail with
`EXDEV: cross-device link not permitted`. The code works fine (and is in
fact throwing an error as desired) but the test fails.

This commit first creates the "source" file in the same directory as the
"destination" (where the hardlink will be created).

PR-URL: #4861
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>

MylesBorins added a commit that referenced this pull request Feb 18, 2016

test: fs.link() test runs on same device
When running the tests if `NODE_TEST_DIR` is set to a device different
than the location of the test files (where this repo is checked out),
then the parallel/test-fs-link.js test will fail with
`EXDEV: cross-device link not permitted`. The code works fine (and is in
fact throwing an error as desired) but the test fails.

This commit first creates the "source" file in the same directory as the
"destination" (where the hardlink will be created).

PR-URL: #4861
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>

@MylesBorins MylesBorins referenced this pull request Feb 18, 2016

Merged

V4.4.0 proposal #5301

MylesBorins added a commit that referenced this pull request Mar 2, 2016

test: fs.link() test runs on same device
When running the tests if `NODE_TEST_DIR` is set to a device different
than the location of the test files (where this repo is checked out),
then the parallel/test-fs-link.js test will fail with
`EXDEV: cross-device link not permitted`. The code works fine (and is in
fact throwing an error as desired) but the test fails.

This commit first creates the "source" file in the same directory as the
"destination" (where the hardlink will be created).

PR-URL: #4861
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>

scovetta pushed a commit to scovetta/node that referenced this pull request Apr 2, 2016

test: fs.link() test runs on same device
When running the tests if `NODE_TEST_DIR` is set to a device different
than the location of the test files (where this repo is checked out),
then the parallel/test-fs-link.js test will fail with
`EXDEV: cross-device link not permitted`. The code works fine (and is in
fact throwing an error as desired) but the test fails.

This commit first creates the "source" file in the same directory as the
"destination" (where the hardlink will be created).

PR-URL: nodejs#4861
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.