[Erp5-report] r35574 jm - in /erp5/trunk/products: ERP5/tests/ ERP5Type/tests/

nobody at svn.erp5.org nobody at svn.erp5.org
Mon May 24 16:52:21 CEST 2010


Author: jm
Date: Mon May 24 16:52:20 2010
New Revision: 35574

URL: http://svn.erp5.org?rev=35574&view=rev
Log:
Unit tests: add msecs to zLOG.log + improvements to _testInvalidationBug

Modified:
    erp5/trunk/products/ERP5/tests/_testInvalidationBug.py
    erp5/trunk/products/ERP5Type/tests/runUnitTest.py

Modified: erp5/trunk/products/ERP5/tests/_testInvalidationBug.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/_testInvalidationBug.py?rev=35574&r1=35573&r2=35574&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/_testInvalidationBug.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/_testInvalidationBug.py [utf8] Mon May 24 16:52:20 2010
@@ -52,12 +52,17 @@
     self.login()
 
   def testReindex(self):
-    self.login()
+    print("To reproduce bugs easily, distribution step should be skipped for"
+          " SQLDict, by writing messages with processing_node already at 0."
+          " This can be done easily by patching SQLDict_writeMessageList.")
     module = self.getPortalObject().organisation_module
+    module.newContent()
     module.setIdGenerator('_generatePerDayId')
-    module.migrateToHBTree()
+    #module.migrateToHBTree()
     transaction.commit()
     self.tic()
+    print 'OID(%s) = %r' % (module.getRelativeUrl(), module._p_oid)
+    print '  OID(_tree) = %r' % module._tree._p_oid
     previous = DateTime()
     skin_folder = self.getPortal().portal_skins.custom
     if 'create_script' in skin_folder.objectIds():
@@ -71,19 +76,20 @@
   id_list.append(organisation.getId())
 log('Created Organisations', (context,id_list))
 #log('All organisations', (context,[x for x in context.objectIds()]))
-context.activate(activity='SQLQueue').create_script()
+context.activate(activity='SQLQueue', priority=2).create_script()
 
 count = len(context)
 log('Organisation #', count)
-if not (count % 500):
-  if count == 500:
-    context.setProperty('perf_start', DateTime())
+if (count % 500) < 5:
+  start = context.getProperty('perf_start')
+  if start is None:
+    context.setProperty('perf_start', (count, DateTime()))
   else:
-    log('creation speed: %s obj/s' % ((count - 500) /
-        (86400 * (DateTime() - context.getProperty('perf_start')))))
+    log('creation speed: %s obj/s' % ((count - start[0]) /
+        (86400 * (DateTime() - start[1]))))
 """)
     for x in xrange(0,200):
-      module.activate(activity='SQLQueue').create_script()
+      module.activate(activity='SQLQueue', priority=2).create_script()
     transaction.commit()
     self.tic()
 

Modified: erp5/trunk/products/ERP5Type/tests/runUnitTest.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/tests/runUnitTest.py?rev=35574&r1=35573&r2=35574&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/tests/runUnitTest.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/tests/runUnitTest.py [utf8] Mon May 24 16:52:20 2010
@@ -386,7 +386,7 @@
     from ZConfig.components.logger.logger import EventLogFactory
     import logging
     section = SectionValue({'dateformat': '%Y-%m-%d %H:%M:%S',
-                            'format': '%(asctime)s %(levelname)s %(name)s %(message)s',
+                            'format': '%(asctime)s.%(msecs)03d %(levelname)s %(name)s %(message)s',
                             'level': logging.INFO,
                             'path': os.environ['EVENT_LOG_FILE'],
                             'max_size': None,




More information about the Erp5-report mailing list