Leftover ./instances from test runs can make tests fail locally

Bug #1664669 reported by Matt Riedemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Ilya Popov

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.

Matt Riedemann (mriedem)
summary: - Leftover nova/instances from test runs can make tests fail locally
+ Leftover ./instances from test runs can make tests fail locally
description: updated
Changed in nova:
assignee: nobody → Maciej Szankin (mszankin)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/433948

Changed in nova:
status: Confirmed → In Progress
Changed in nova:
status: In Progress → Confirmed
assignee: Maciej Szankin (mszankin) → nobody
Revision history for this message
Sean Dague (sdague) wrote :

Automatically discovered version mitaka in description. If this is incorrect, please update the description to include 'nova version: ...'

tags: added: openstack-version.mitaka
Sean Dague (sdague)
Changed in nova:
assignee: nobody → Maciej Szankin (mszankin)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Sean Dague (<email address hidden>) on branch: master
Review: https://review.openstack.org/433948
Reason: This review is > 4 weeks without comment, and is not mergable in it's current state. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Revision history for this message
Sean Dague (sdague) wrote :

There are no currently open reviews on this bug, changing the status back to the previous state and unassigning. If there are active reviews related to this bug, please include links in comments.

Changed in nova:
status: In Progress → Confirmed
assignee: Maciej Szankin (mszankin) → nobody
Ilya Popov (ilya-p)
Changed in nova:
assignee: nobody → Ilya Popov (ilya-p)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/491589

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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 address hidden>
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
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 17.0.0.0b1

This issue was fixed in the openstack/nova 17.0.0.0b1 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.