Skip to content

Commit

Permalink
Use resources/cp/file1 and add sleep to workaround possible racing
Browse files Browse the repository at this point in the history
  • Loading branch information
dwi2 committed May 17, 2018
1 parent 3ede418 commit 4760a76
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/cp.js
Expand Up @@ -758,8 +758,8 @@ test('should not overwrite recently created files (not give error no-force mode)
});

test('cp -p should preserve mode, ownership, and timestamp', t => {
const result = shell.cp('-p', 'test/resources/file1', `${t.context.tmp}/preservedFile1`);
const stat = common.statFollowLinks('test/resources/file1');
const result = shell.cp('-p', 'test/resources/cp/file1', `${t.context.tmp}/preservedFile1`);
const stat = common.statFollowLinks('test/resources/cp/file1');
const statOfResult = common.statFollowLinks(`${t.context.tmp}/preservedFile1`);

t.is(result.code, 0);
Expand All @@ -772,6 +772,7 @@ test('cp -p should preserve mode, ownership, and timestamp', t => {

test('cp -p should preserve mode, ownership, and timestamp of symlink', t => {
const result = shell.cp('-p', 'test/resources/link', `${t.context.tmp}/copiedLink`);
utils.sleep(1000);
const stat = common.statFollowLinks('test/resources/link');
const statOfResult = common.statFollowLinks(`${t.context.tmp}/copiedLink`);

Expand Down

0 comments on commit 4760a76

Please sign in to comment.