Testing databases are not dropped after some tests
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
zaqar |
In Progress
|
Undecided
|
Eva Balycheva |
Bug Description
Example of affected test class: https:/
After executing this test class, the databases still remain in filesystem, consuming space.
And also every time when I run "tox -e py27" two times in a row without a time delay between these commands, some tests fail on the second execution of "tox -e py27".
Examples of failed tests:
http://
http://
If I manually wipe databases before running "tox -e py27" again, all tests pass.
Each invoke of tearDown() method just removes the created queue from one of the databases and checks if queue removal have returned the right status code in response. So the database is fresh and clean and can be reused by the remaining test methods. It's okay.
Exceptions are pools and catalogue databases which are always dropped on each invoke of tearDown(), if polling is enabled, because of the tearDown() method in parent test class:
See https:/
But when no test methods left, the databases have to be dropped. But it doesn't happen.
So...
Possible solution for the affected test class:
Implement tearDownClass(cls) method which will be automatically invoked after all test class's methods finish their execution.
In this method all testing databases will be dropped.
See https:/
But currently tearDownClass(cls) method is not used anywhere in Zaqar's tests. Why is it avoided?
But maybe the behavior that keeps databases undropped was implemented on purpose and I just don't see why.
Fixing this bug will require a plenty of work, but...
1. Is it really a bug so it needs to be fixed?
2. Is the solution I proposed good? (I'm a newbie and maybe don't know something)
Please leave your thoughts in comments.
Changed in zaqar: | |
assignee: | nobody → Eva Balycheva (ubershy) |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
Changed in zaqar: | |
status: | Confirmed → In Progress |
Yeah, I'm able to repro this locally. It would be great to have these cleaned up automatically.