Commit 8e1267d9 authored by Jérome Perrin's avatar Jérome Perrin Committed by Aurel

runUnitTest: set HTTPRequest.retry_max_count

In case of ConflictError, request will be retied for
HTTPRequest.retry_max_count times. For Zope 2, the default value of the
class attribute was 3, but on Zope 4, default value is 0 and this is set
to 3 on startup (by Zope2.Startup.handlers.root_wsgi_handler).
This startup code is not executed by runUnitTest, we need to set
HTTPRequest.retry_max_count somewhere, otherwise ConflictError are not
retried during tests.
parent b4c2ee26
...@@ -546,6 +546,9 @@ def runUnitTestList(test_list, verbosity=1, debug=0, run_only=None): ...@@ -546,6 +546,9 @@ def runUnitTestList(test_list, verbosity=1, debug=0, run_only=None):
# Set debug mode after importing ZopeLite that resets it to 0 # Set debug mode after importing ZopeLite that resets it to 0
cfg.debug_mode = debug cfg.debug_mode = debug
from ZPublisher.HTTPRequest import HTTPRequest
HTTPRequest.retry_max_count = 3
from ZConfig.components.logger import handlers, logger, loghandler from ZConfig.components.logger import handlers, logger, loghandler
import logging import logging
root_logger = logging.getLogger() root_logger = logging.getLogger()
......
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