Commit 96b70605 authored by Julien Muchembled's avatar Julien Muchembled

runUnitTest: distribute activities automatically if there is only 1 node and no test to run

parent a303a379
...@@ -239,7 +239,8 @@ class ProcessingNodeTestCase(backportUnittest.TestCase, ZopeTestCase.TestCase): ...@@ -239,7 +239,8 @@ class ProcessingNodeTestCase(backportUnittest.TestCase, ZopeTestCase.TestCase):
def afterSetUp(self): def afterSetUp(self):
"""Initialize a node that will only process activities""" """Initialize a node that will only process activities"""
self.startZServer() self.startZServer()
self._registerNode(distributing=0, processing=1) from Zope2.custom_zodb import cluster
self._registerNode(distributing=not cluster, processing=1)
transaction.commit() transaction.commit()
def processing_node(self): def processing_node(self):
......
...@@ -115,6 +115,8 @@ def forkNodes(): ...@@ -115,6 +115,8 @@ def forkNodes():
break break
node_pid_list.append(pid) node_pid_list.append(pid)
cluster = True
if neo_storage: if neo_storage:
if load or save or zeo_client: if load or save or zeo_client:
raise Exception("--neo_storage conflicts with --load/save/zeo_client") raise Exception("--neo_storage conflicts with --load/save/zeo_client")
...@@ -144,6 +146,8 @@ else: ...@@ -144,6 +146,8 @@ else:
elif activity_node is not None: elif activity_node is not None:
# run ZEO server but no need to fork # run ZEO server but no need to fork
zeo_server_pid = 0 zeo_server_pid = 0
else:
cluster = False
if save: if save:
Storage = FileStorage(data_fs_path) Storage = FileStorage(data_fs_path)
......
...@@ -487,7 +487,6 @@ def runUnitTestList(test_list, verbosity=1, debug=0, run_only=None): ...@@ -487,7 +487,6 @@ def runUnitTestList(test_list, verbosity=1, debug=0, run_only=None):
TestRunner = backportUnittest.TextTestRunner TestRunner = backportUnittest.TextTestRunner
import Lifetime import Lifetime
from ZEO.ClientStorage import ClientStorage
from Zope2.custom_zodb import Storage, save_mysql, \ from Zope2.custom_zodb import Storage, save_mysql, \
node_pid_list, neo_cluster, zeo_server_pid node_pid_list, neo_cluster, zeo_server_pid
def shutdown(signum, frame, signum_set=set()): def shutdown(signum, frame, signum_set=set()):
......
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