Commit d5976297 authored by Julien Muchembled's avatar Julien Muchembled

Unit tests: add msecs to zLOG.log + improvements to _testInvalidationBug

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35574 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 46d30269
master PROD_COMP2108@20150821 PROD_COMP2117@20150821 accessor_setter_security accounting_constraint_bug_ignore_acquired_source_destination_when_closing accounting_grouping_reference_ignore_mirror_account bt_20150921-1487839 bt_component_broken bt_review budget_component budget_time_variation cleanup/translation_mapping_utf8 cleanup_interface code_mirror code_mirror_jerome_patches_2file_bt codemirror_5.13.4 configurator_cleanups delivery_type_information dist-0.4.63 do_not_modify_folder_while_migratinng erp5-vifib-print-and-hashseed feat/accounting_add_back_third_party_column_in_gl feat/accounting_balance_sheet_profit_and_loss_cleanups feat/accounting_grouping_dialog_search_by_section_category_and_fixs feat/accounting_internal_invoice feat/accounting_sort_aged_balance feat/activities-clean-shutdown feat/bank_reconciliation_direct_stock_columns feat/bt_xml_zope2_zope4 feat/cmfactivity_notification feat/coverage feat/data_protection feat/doc-generator feat/jedi feat/less-seleniumrunner-install feat/line-report-parrallel feat/monaco-ruff feat/note_before_migration feat/pdm_measure_cell_range feat/py2zope4 feat/random_runUnitTest_port feat/remove_owner_role_permissions_on_document_workflow feat/restricted_collections feat/simplemde feat/simplemde-text-editor feat/support_request_translation feat/yapf fix/#20170313-5DDBB0 fix/988_workaround fix/auth-cookies fix/bug_20161227-D1FA4 fix/category-export fix/check_authentication_policy fix/configurator_consistency fix/control-characters-in-odf-syles fix/egg_test_revision_history fix/enable-xml-rpc fix/erp5testnode-build-failures fix/graph_editor fix/hashseed fix/mobyt-new-url fix/python3-syntax fix/remove_obfuscated_url_from_test fix/runUnitTest_localhost fix/testnode-killProcess fix/testnode-loose-supervisord fix/testnode_proctitle fix/trial_balance_empty_gap fix_func_test fixes for_testrunner_1 graph_editor_wip inventory_api_do_not_group_movement_history_list inventory_api_flow inventory_api_group_by_time_sequence inventory_api_group_by_time_sequence_backport_master_no_guard_on_workflow_transition inventory_api_group_by_time_sequence_first_try inventory_api_group_by_time_sequence_rebased inventory_api_interpolation_method jedi_autocomplete jedi_python_autocomplete jerome_clone_transformation ledger_vs_grouping_reference linecache_ipython3 listbox_module_proxy_field listbox_proxy_field_more_columns listbox_unicode_url_method live_test_lets_crash mass_workflow master_calendar_wip_patchs master_no_guard_on_workflow_transition_plus_calendar_wip_patchs_plus_upgrader_refactoring move_budget_to_component ods_style_sheet_per_report_section_deferred_style_before_rebase old_patches ooo_url_remove_address_port palo periodicity_getNextPeriodicityDate_test_give_up pivot_table py2zope4 pyflake_vs_pylint shop-box-work small_ui_fixes_editable_field sms_activate_before_rebase sms_more_than_140_characters software_link spellcheck_slowdown_chrome style_on_accounting_reports tax_return_and_type_of_type test/selenium_repro testnode_runner testnode_runner2 testnode_runner_clean testnode_software_link tmp/authentication_policy2_wip tmp/authentication_policy_fixes_before_rebase tmp/authentication_policy_no_immediateReindex tmp/constructUrlFor tmp/georges tmp/invalid_html_to_verify_w3_validator tmp/mr185_review tmp/rjs-translations tmp/tmp tmp/tmpx tmp1 tmp_commits_for_nicolas upgrader_post_upgrade_after_upgrade_activities web_site_clone_before_traversal_hooks wip/catalog_tool_extra_column_list_for_inventory_api_slot_index wip/chartsjs_and_worklists wip/cmf_activity_runtime_grouped wip/component_editor_gadget wip/configurator_trade wip/copy_reg_NamedAssignment wip/corporate_cloudooo_fonts wip/empty_criterion wip/feat/payment_transaction_group_ERPJS wip/interpolation_0_rebase wip/loyalty_with_tml wip/monaco wip/monaco-editor wip/monaco-jshint wip/neo wip/quick_erp5_test wip/restricted_iterator wip/seleniumserver wip/stock_browser wip/testUpgradeInstanceWithOldDataFs_reference_json wip/testnode-kill-previous-before-reinitializing wip/tmp wip/wip wip/xiaowu_convert_round_debit_credit wip_search_portal_component wipwipwip work zope4py2 zope4py2b zope4py3 zope4py3-before-arnaud-rebase zope4py3-bt-protocol1onpy3 zope4py3-rebase-starting-point zope4py3-tmp zope4py3-wip 0.4.59.1 0.4.59 wip/configurator_trade_old erp5.util-0.4.64 erp5.util-0.4.63 erp5.util-0.4.62 erp5.util-0.4.61 erp5.util-0.4.58 erp5.util-0.4.57 erp5.util-0.4.56 erp5.util-0.4.55 erp5.util-0.4.54 erp5.util-0.4.53 erp5.util-0.4.52 erp5.util-0.4.49 erp5.util-0.4.46 erp5.util-0.4.44 erp5.util-0.4.43 erp5.util-0.4.41 erp5.util-0.4.40 erp5.util-0.4.37 erp5.util-0.4.1 erp5.util-0.4 erp5.util-0.3 erp5.util-0.2 erp5.util-0.1
No related merge requests found
...@@ -52,12 +52,17 @@ class TestInvalidationBug(ERP5TypeTestCase): ...@@ -52,12 +52,17 @@ class TestInvalidationBug(ERP5TypeTestCase):
self.login() self.login()
def testReindex(self): 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 = self.getPortalObject().organisation_module
module.newContent()
module.setIdGenerator('_generatePerDayId') module.setIdGenerator('_generatePerDayId')
module.migrateToHBTree() #module.migrateToHBTree()
transaction.commit() transaction.commit()
self.tic() self.tic()
print 'OID(%s) = %r' % (module.getRelativeUrl(), module._p_oid)
print ' OID(_tree) = %r' % module._tree._p_oid
previous = DateTime() previous = DateTime()
skin_folder = self.getPortal().portal_skins.custom skin_folder = self.getPortal().portal_skins.custom
if 'create_script' in skin_folder.objectIds(): if 'create_script' in skin_folder.objectIds():
...@@ -71,19 +76,20 @@ for x in xrange(0, 1): ...@@ -71,19 +76,20 @@ for x in xrange(0, 1):
id_list.append(organisation.getId()) id_list.append(organisation.getId())
log('Created Organisations', (context,id_list)) log('Created Organisations', (context,id_list))
#log('All organisations', (context,[x for x in context.objectIds()])) #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) count = len(context)
log('Organisation #', count) log('Organisation #', count)
if not (count % 500): if (count % 500) < 5:
if count == 500: start = context.getProperty('perf_start')
context.setProperty('perf_start', DateTime()) if start is None:
context.setProperty('perf_start', (count, DateTime()))
else: else:
log('creation speed: %s obj/s' % ((count - 500) / log('creation speed: %s obj/s' % ((count - start[0]) /
(86400 * (DateTime() - context.getProperty('perf_start'))))) (86400 * (DateTime() - start[1]))))
""") """)
for x in xrange(0,200): for x in xrange(0,200):
module.activate(activity='SQLQueue').create_script() module.activate(activity='SQLQueue', priority=2).create_script()
transaction.commit() transaction.commit()
self.tic() self.tic()
......
...@@ -386,7 +386,7 @@ def runUnitTestList(test_list, verbosity=1, debug=0): ...@@ -386,7 +386,7 @@ def runUnitTestList(test_list, verbosity=1, debug=0):
from ZConfig.components.logger.logger import EventLogFactory from ZConfig.components.logger.logger import EventLogFactory
import logging import logging
section = SectionValue({'dateformat': '%Y-%m-%d %H:%M:%S', 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, 'level': logging.INFO,
'path': os.environ['EVENT_LOG_FILE'], 'path': os.environ['EVENT_LOG_FILE'],
'max_size': None, 'max_size': None,
......
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