Commit 260445e2 authored by Vincent Pelletier's avatar Vincent Pelletier

Only disable GC when a test is run, to avoid disabling GC for everybody...

Only disable GC when a test is run, to avoid disabling GC for everybody importing the file. I'm not sure if GC should be re-enabled at tear down, and prefer not to do so for the moment.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21167 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 29e8d48a
......@@ -53,17 +53,6 @@ MAX_TIC=0.0355
LISTBOX_COEF=0.02472
DO_TEST = 1
# Prevent GC from happening.
# We don't want cpu time to be spent outside of python code if possible.
# It would increase the "crosstalk" between using more ram and using more cpu.
# Another problem is that it makes result even less reproductible on another
# machine where memory use does not evolve identicaly (ie. x86_64 arch,
# because of 64bits pointers).
gc.disable()
# XXX: Maybe it would be usefull to explicitely collect garbage in some places
# to keep memory usage low. But it is generaly bad to apply the cure before
# even knowing if the symptoms will show up.
class TestPerformance(ERP5TypeTestCase, LogInterceptor):
# Some helper methods
......@@ -90,6 +79,16 @@ class TestPerformance(ERP5TypeTestCase, LogInterceptor):
"""
Executed before each test_*.
"""
# Prevent GC from happening.
# We don't want cpu time to be spent outside of python code if possible.
# It would increase the "crosstalk" between using more ram and using more cpu.
# Another problem is that it makes result even less reproductible on another
# machine where memory use does not evolve identicaly (ie. x86_64 arch,
# because of 64bits pointers).
gc.disable()
# XXX: Maybe it would be usefull to explicitely collect garbage in some places
# to keep memory usage low. But it is generaly bad to apply the cure before
# even knowing if the symptoms will show up.
self.login()
self.bar_module = self.getBarModule()
self.foo_module = self.portal.foo_module
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment