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

Add test to make sure files are not being left open after sync tasks #1232

Merged
merged 1 commit into from
Dec 5, 2018

Conversation

dralley
Copy link
Contributor

@dralley dralley commented Dec 2, 2018

@dralley dralley force-pushed the file-close-test branch 4 times, most recently from 427fc91 to 0061b12 Compare December 2, 2018 04:30
"""
pkg_mgr = cli.PackageManager(self.cfg)
pkg_mgr.raise_if_unsupported(unittest.SkipTest)
pkg_mgr.install('lsof')
Copy link
Contributor Author

@dralley dralley Dec 2, 2018

Choose a reason for hiding this comment

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

@kersommoura I left this just as it was committed to pulp_file, but I kind of think it would be better if the test didn't try to do install or uninstall anything - just check if lsof is available and skip if it isn't installed. The reason being, if the user already had lsof installed, either individually or as a dependency for another application, wouldn't the next line would remove it from their system? I don't think we should be doing anything that would make permanent changes to the system configuration of the host machine.

I think it would make more sense to document dependencies like this and have the user (or the CI box configuration scripts) make sure they're installed if they want that test to be run.

Also, lsof is installed on Travis (or maybe it's included by default with Ubuntu), so doing it this way is needlessly restrictive. If not for the code trying to interact with the system package manager this test would actually work fine in Travis and not need to be skipped.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you agree, I don't mind changing it both here and in pulp_file.

Copy link

Choose a reason for hiding this comment

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

@dralley, thanks for your working on this. I agree. What about we state in the test case something like...this test requires that lsof is available. Otherwise test will be skipped.

@dralley dralley force-pushed the file-close-test branch 4 times, most recently from 99d3fd7 to 90f0413 Compare December 3, 2018 16:48
@dralley
Copy link
Contributor Author

dralley commented Dec 4, 2018

@pulp/qe

@dralley dralley merged commit 9c75e56 into pulp:master Dec 5, 2018
@dralley dralley deleted the file-close-test branch December 5, 2018 16:04
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