Reviewed: https://review.openstack.org/491589 Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=c337dd42c025a64b009da74d4a6e0b3ae3fa5e24 Submitter: Jenkins Branch: master
commit c337dd42c025a64b009da74d4a6e0b3ae3fa5e24 Author: Ilya Popov <[email protected]> Date: Wed Aug 9 15:33:10 2017 +0300 Tests: Add cleanup of 'instances' directory 'instances' directory was never cleaned up, which might have resulted in test_rescue() test trying to chown this directory while not having permissions to do such thing. Fix removes directories after tests finished. Tests use fake instance, created with _create_instance. Method _create_instance uses fixed uuid for instance object. Tests are executed through several workers, so they could start simultaneously. If one test created folder with the same uuid, the second one could delete it before the first test finished. It could lead the first test to fail. The solution is to use generated nstance uuid and delete particular uuid folder after test is completed. Instance folder won't be deleted, as it could be used by other tests. Change-Id: I985a414ac6dfc608e1a3ed68c580d0b08da45a91 Closes-Bug: 1664669 ** Changed in: nova Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova). https://bugs.launchpad.net/bugs/1664669 Title: Leftover ./instances from test runs can make tests fail locally Status in OpenStack Compute (nova): Fix Released Bug description: I noticed this while running unit tests on stable/mitaka, but I think it applies to other branches including master. When you run tox -r -e py27 you'll have a ./instances directory created, I think from the state_path variable used in the libvirt driver. ./keys is also created and left around, but wasn't an issue for me. On stable/mitaka, because of the files existing on disk in ./instances, the test_rescue() test in the libvirt driver would find a file that exists (which normally wouldn't) and tries to chown it, which hangs the test process on sudo prompting for a password. Ideally the tests would cleanup any resources they create, but as a quick fix we could simply just rm -rf ./instances from tox.ini when we run tests, just like we do with removing *.pyc files. To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1664669/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

