Skip to content

TEST: Do not test copy idempotence for unlinked files #1586

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

Merged
merged 3 commits into from
Aug 21, 2016

Conversation

effigies
Copy link
Member

Not actually a bug, since there's no harm in what we were doing, but the test from #1570 caught unexpected behavior. Seen in test failure for #1379.

The general rule when creating symlinks in copyfile is: if the new symlink will point to the same place as the old, do not replace. When creating a symlink from a symlink, though, it does not dereference the source symlink to check whether the end reference would be the same, and so always removes and recreates the destination symlink.

This brings the behavior with a symlink source file in line with behavior for a regular source file.

Separated the test to be more thorough and added error messages for debugging.

@coveralls
Copy link

coveralls commented Aug 19, 2016

Coverage Status

Changes Unknown when pulling 05f393b on effigies:fix_linkchain_test into * on nipy:master*.

@coveralls
Copy link

coveralls commented Aug 19, 2016

Coverage Status

Changes Unknown when pulling 05f393b on effigies:fix_linkchain_test into * on nipy:master*.

1 similar comment
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 05f393b on effigies:fix_linkchain_test into * on nipy:master*.

@effigies
Copy link
Member Author

Okay, so my understanding was off. Symlinking symlinks was valid, so checking realpaths may not be correct.

That said, it's unclear to me why, on CircleCI (this hasn't been an issue on my local machines) the symlink to the symlink was being deleted and re-created. I'm trying to track that down.

It may simply be we don't care and should just skip on that case. Thoughts?

@effigies effigies force-pushed the fix_linkchain_test branch from 05f393b to 196f464 Compare August 19, 2016 17:18
@effigies effigies changed the title FIX: Make file copying behave consistently when source file is a symlink TEST: Do not test copy idempotence for unlinked files Aug 19, 2016
@effigies
Copy link
Member Author

Sorry. Screwed up again. The problem wasn't symlinks at all, but that copying could change the timestamp, which one of the hashmethods uses to decide whether two files are the same. Reverted the symlink changes, checked both hashmethods, and put in an exception for that case.

This should be ready to go, but I suppose we'll see whether I messed up yet again.

@coveralls
Copy link

coveralls commented Aug 19, 2016

Coverage Status

Changes Unknown when pulling 196f464 on effigies:fix_linkchain_test into * on nipy:master*.

@oesteban oesteban merged commit 304ffa4 into nipy:master Aug 21, 2016
@effigies effigies deleted the fix_linkchain_test branch August 21, 2016 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants