[Erp5-report] r23711 - /erp5/trunk/products/ERP5Type/tests/testCacheTool.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Sep 19 10:31:58 CEST 2008
Author: jerome
Date: Fri Sep 19 10:31:54 2008
New Revision: 23711
URL: http://svn.erp5.org?rev=23711&view=rev
Log:
increase the number of iterations otherwise the method might take less than one second to compute
Modified:
erp5/trunk/products/ERP5Type/tests/testCacheTool.py
Modified: erp5/trunk/products/ERP5Type/tests/testCacheTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/tests/testCacheTool.py?rev=23711&r1=23710&r2=23711&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/tests/testCacheTool.py (original)
+++ erp5/trunk/products/ERP5Type/tests/testCacheTool.py Fri Sep 19 10:31:54 2008
@@ -240,17 +240,21 @@
print
print "="*40
print "TESTING:", cf_name
+
+ # if the test fails because your machine is too fast, increase this value.
+ nb_iterations = 30000
+
portal.portal_caches.clearCacheFactory(cf_name)
## 1st call
start = time.time()
- original = my_cache(20000, portal_path=('', portal.getId()))
+ original = my_cache(nb_iterations, portal_path=('', portal.getId()))
end = time.time()
calculation_time = end-start
print "\n\tCalculation time (1st call)", calculation_time
## 2nd call - should be cached now
start = time.time()
- cached = my_cache(20000, portal_path=('', portal.getId()))
+ cached = my_cache(nb_iterations, portal_path=('', portal.getId()))
end = time.time()
calculation_time = end-start
print "\n\tCalculation time (2nd call)", calculation_time
@@ -269,7 +273,7 @@
## 1st call
start = time.time()
- original = my_cache(20000, portal_path=('', portal.getId()))
+ original = my_cache(nb_iterations, portal_path=('', portal.getId()))
end = time.time()
calculation_time = end-start
print "\n\tCalculation time (after cache clear)", calculation_time
More information about the Erp5-report
mailing list