<html><body>
<p><font size="2" face="sans-serif">Sorry for late reply and thanks for bring this out, I agree the create_db flag will increase the complexity</font><br>
<font size="2" face="sans-serif">so I might do some PoC and write a spec to do it next release</font><br>
<br>
<font size="2" face="sans-serif">For this sentence, I don't fully understand, are you suggesting to every db usage remove should be a</font><br>
<font size="2" face="sans-serif">patch for a test class? thanks a lot</font><br>
<tt><font size="2"><i>I'd like to propose instead DB usage should be removed per test Class as<br>
an atomic unit.</i></font></tt><br>
<br>
<font size="2" face="sans-serif">Best Regards! <br>
<br>
Kevin (Chen) Ji ¼Í ³¿<br>
<br>
Engineer, zVM Development, CSTL<br>
Notes: Chen CH Ji/China/IBM@IBMCN Internet: jichenjc@cn.ibm.com<br>
Phone: +86-10-82454158<br>
Address: 3/F Ring Building, ZhongGuanCun Software Park, Haidian District, Beijing 100193, PRC </font><br>
<br>
<img width="16" height="16" src="cid:2__=C7BBF748DFCB71DB8f9e8a93df938@cn.ibm.com" border="0" alt="Inactive hide details for Sean Dague ---01/24/2015 07:13:45 PM---I've been looking at the following patch series - https://revi"><font size="2" color="#424282" face="sans-serif">Sean Dague ---01/24/2015 07:13:45 PM---I've been looking at the following patch series - <a href="https://review.openstack.org/#/c/131691/13">https://review.openstack.org/#/c/131691/13</a> for rem</font><br>
<br>
<font size="1" color="#5F5F5F" face="sans-serif">From: </font><font size="1" face="sans-serif">Sean Dague <sean@dague.net></font><br>
<font size="1" color="#5F5F5F" face="sans-serif">To: </font><font size="1" face="sans-serif">"OpenStack Development Mailing List (not for usage questions)" <openstack-dev@lists.openstack.org></font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Cc: </font><font size="1" face="sans-serif">Chen CH Ji/China/IBM@IBMCN</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Date: </font><font size="1" face="sans-serif">01/24/2015 07:13 PM</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Subject: </font><font size="1" face="sans-serif">[nova] proposal for unwinding database usage from tests</font><br>
<hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br>
<br>
<br>
<tt><font size="2">I've been looking at the following patch series -<br>
</font></tt><tt><font size="2"><a href="https://review.openstack.org/#/c/131691/13">https://review.openstack.org/#/c/131691/13</a></font></tt><tt><font size="2"> for removing database<br>
requirements from some tests.<br>
<br>
I whole heartedly support getting DB usage out of tests, but I'd like to<br>
make sure that we don't create new challenges in the process. The<br>
conditional create_db parameter in test functions adds a bit more<br>
internal test complexity than I think we should have.<br>
<br>
I'd like to propose instead DB usage should be removed per test Class as<br>
an atomic unit. If that turns into too large a patch that probably means<br>
breaking apart the test class into smaller test classes first.<br>
<br>
The other thing to be careful in understanding the results of timing<br>
tests. The way the database fixture works it caches the migration<br>
process -<br>
</font></tt><tt><font size="2"><a href="https://github.com/openstack/nova/blob/master/nova/tests/fixtures.py#L206">https://github.com/openstack/nova/blob/master/nova/tests/fixtures.py#L206</a></font></tt><tt><font size="2"><br>
<br>
That actually means that the overhead of the db-migration sync is paid<br>
only once per testr worker (it's 1s on my fast workstation, might be 2s<br>
on gate nodes). The subsequence db setups for tests 2 -> N in the worker<br>
only take about 0.020s on my workstation (scale appropriately). So<br>
removing all the unneeded db setup code is probably only going to save<br>
~30s over an entire test run.<br>
<br>
Which doesn't mean it shouldn't be done, there are other safety reasons<br>
we shouldn't let every test randomly punch data into the db and still<br>
pass. But time savings should not be the primary motivator here, because<br>
it's actually not nearly as much gain as it looks like from running only<br>
a small number of tests.<br>
<br>
-Sean<br>
<br>
-- <br>
Sean Dague<br>
</font></tt><tt><font size="2"><a href="http://dague.net">http://dague.net</a></font></tt><tt><font size="2"><br>
<br>
</font></tt><i>(See attached file: signature.asc)</i><br>
</body></html>