Code review comment for lp:~vishvananda/nova/tests-clean-db

Revision history for this message
Vish Ishaya (vishvananda) wrote :

Jay: I think all of our tests should inherit from the same base class and cleanup in between. That way if someone forgets to leak items into the db (as was happening in some of the openstack api tests), it still gets cleaned properly for the next test.

Now that the set up happens in fixtures, the time difference between the two is negligible. In fact they seem to be virtually the same speed, changing slightly based on system load:

[UNITEST VERSION]
vishvananda@i-uswrlzxk:~/tests-clean-db$ time for i in `seq 1 5`; do python run_tests.py nova.tests.api.openstack.test_servers > /dev/null; done

real 0m16.181s
user 0m5.600s
sys 0m0.590s

[TEST VERSION]
vishvananda@i-uswrlzxk:~/tests-clean-db$ vi nova/tests/api/openstack/test_servers.py
vishvananda@i-uswrlzxk:~/tests-clean-db$ time for i in `seq 1 5`; do python run_tests.py nova.tests.api.openstack.test_servers > /dev/null; done

real 0m15.740s
user 0m5.350s
sys 0m0.780s

I understand why you went the unittest route before (setup of test.TestCase was SLOW!!!) but I don't think there is any reason for it now.

Vish

« Back to merge proposal