[openstack-dev] [Quantum] Unit tests and memory consumption

Monty Taylor mordred at inaugust.com
Tue Oct 23 22:20:52 UTC 2012


I believe that we can address this for both run_tests and tox with some
of the testtools/fixtures stuff clark has been playing with. We'll poke
at it tomorrow (he's out for the day) and see if we can get an approach
that would make everyone happy.

On 10/23/2012 03:11 PM, Vishvananda Ishaya wrote:
> The old code used to use a clean sqlite db file called sqlite.clean and copy it before each test is still in the tree. It looks like there is a small bug where setup is no longer called but otherwise it works and is pretty fast. Can you try this patch and see how it works memory wise?
> 
> https://gist.github.com/3941981
> 
> It works with run_tests.sh which explicitly deletes the tests.sqlite before running tests, not sure if it will work with tox.
> 
> Vish
> 
> On Oct 23, 2012, at 2:58 AM, Gary Kotton <gkotton at redhat.com> wrote:
> 
>> Hi,
>> I have been looking into bug 1065276 (https://bugs.launchpad.net/quantum/+bug/1065276). The problem is that the memory is not freed for each unit test. There are essentially two consumers:
>> 1. self.api = APIRouter(). This uses 1488K. This is essentially the loading of the plugin, creation of database (sqllite) and local data structures etc. This is call in the setup method.
>> 2. Database usage - this depends on the test in question.
>>
>> In the teardown method I have tried a number of things but to no avail:
>> i. dropping the database - the memory consumption actually increases
>> ii. clearing the database - same as above (actually I have found a bug here but this is not related)
>> iii. deleting the self.api - no change
>>
>> In short the memory usage just grows per test. I have also tried doing some garbage collection but this too has proved fruitless. We have tried using a file for the database but this was very time consuming for the unit tests.
>>
>> Any help will be greatly appreciated.
>> Thanks
>> Gary
>>
>>
>> _______________________________________________
>> OpenStack-dev mailing list
>> OpenStack-dev at lists.openstack.org
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 
> 
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 



More information about the OpenStack-dev mailing list