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

Handle symlinks better #536

Merged
merged 2 commits into from
Jul 11, 2017
Merged

Handle symlinks better #536

merged 2 commits into from
Jul 11, 2017

Conversation

tylertreat
Copy link
Contributor

It's hard to implement a bulletproof solution for cleaning up the
symlinks created by config reload tests on failure since, for example,
there is nothing we can do when log.Fatal is called. Instead, prevent
the existence of a symlink from failing the tests if there is one
hanging around. Generally, these symlinks will not be left unless
os.Exit was called (as is the case with log.Fatal).

Fixes #534

@nats-io/core

It's hard to implement a bulletproof solution for cleaning up the
symlinks created by config reload tests on failure since, for example,
there is nothing we can do when log.Fatal is called. Instead, prevent
the existence of a symlink from failing the tests if there is one
hanging around. Generally, these symlinks will not be left unless
os.Exit was called (as is the case with log.Fatal).
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.07%) to 91.058% when pulling 136355f on fix_symlink_garbage into 8a1ac81 on master.

@kozlovic
Copy link
Member

What if all your symlink had a common root name, what we could do is, in the init(), have all files starting with the root name and ending with .conf be removed. So although that would not leave the directory clean on failure, it will clean it up before the next run starts. Alternatively, if we are sure that we will never have .conf file in /server, then we could blindly remove all .conf files.

Copy link
Member

@ColinSullivan1 ColinSullivan1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@kozlovic
Copy link
Member

LGTM

@tylertreat tylertreat merged commit d0a2661 into master Jul 11, 2017
@tylertreat tylertreat deleted the fix_symlink_garbage branch July 11, 2017 16:12
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.

4 participants