diff options
Diffstat (limited to 'src/mailman/testing')
| -rw-r--r-- | src/mailman/testing/helpers.py | 20 | ||||
| -rw-r--r-- | src/mailman/testing/layers.py | 2 | ||||
| -rw-r--r-- | src/mailman/testing/testing.cfg | 24 |
3 files changed, 22 insertions, 24 deletions
diff --git a/src/mailman/testing/helpers.py b/src/mailman/testing/helpers.py index ed579e39c..1a168dd0c 100644 --- a/src/mailman/testing/helpers.py +++ b/src/mailman/testing/helpers.py @@ -66,20 +66,18 @@ from mailman.utilities.mailbox import Mailbox def make_testable_runner(runner_class, name=None, predicate=None): - """Create a queue runner that runs until its queue is empty. + """Create a runner that runs until its queue is empty. - :param runner_class: The queue runner's class. + :param runner_class: The runner class. :type runner_class: class :param name: Optional queue name; if not given, it is calculated from the class name. :type name: string or None :param predicate: Optional alternative predicate for deciding when to stop - the queue runner. When None (the default) it stops when the queue is - empty. + the runner. When None (the default) it stops when the queue is empty. :type predicate: callable that gets one argument, the queue runner. :return: A runner instance. """ - if name is None: assert runner_class.__name__.endswith('Runner'), ( 'Unparseable runner class name: %s' % runner_class.__name__) @@ -169,22 +167,22 @@ class TestableMaster(Master): # which would mean the signal.pause() never exits. pass - def start(self, *qrunners): + def start(self, *runners): """Start the master.""" - self.start_qrunners(qrunners) + self.start_runners(runners) self.thread.start() # Wait until all the children are definitely started. self.event.wait() def stop(self): """Stop the master by killing all the children.""" - for pid in self.qrunner_pids: + for pid in self.runner_pids: os.kill(pid, signal.SIGTERM) self.cleanup() self.thread.join() def loop(self): - """Wait until all the qrunners are actually running before looping.""" + """Wait until all the runners are actually running before looping.""" starting_kids = set(self._kids) while starting_kids: for pid in self._kids: @@ -207,8 +205,8 @@ class TestableMaster(Master): super(TestableMaster, self).loop() @property - def qrunner_pids(self): - """The pids of all the child qrunner processes.""" + def runner_pids(self): + """The pids of all the child runner processes.""" for pid in self._started_kids: yield pid diff --git a/src/mailman/testing/layers.py b/src/mailman/testing/layers.py index 38d4c7f02..6ae9d195e 100644 --- a/src/mailman/testing/layers.py +++ b/src/mailman/testing/layers.py @@ -99,7 +99,7 @@ class ConfigLayer(MockAndMonkeyLayer): # We need a test configuration both for the foreground process and any # child processes that get spawned. lazr.config would allow us to do # it all in a string that gets pushed, and we'll do that for the - # foreground, but because we may be spawning processes (such as queue + # foreground, but because we may be spawning processes (such as # runners) we'll need a file that we can specify to the with the -C # option. Craft the full test configuration string here, push it, and # also write it out to a temp file for -C. diff --git a/src/mailman/testing/testing.cfg b/src/mailman/testing/testing.cfg index ddb0f8440..8ed784621 100644 --- a/src/mailman/testing/testing.cfg +++ b/src/mailman/testing/testing.cfg @@ -25,40 +25,40 @@ incoming: mailman.testing.mta.FakeMTA [webservice] port: 9001 -[qrunner.archive] +[runner.archive] max_restarts: 1 -[qrunner.bounces] +[runner.bounces] max_restarts: 1 -[qrunner.command] +[runner.command] max_restarts: 1 -[qrunner.in] +[runner.in] max_restarts: 1 -[qrunner.lmtp] +[runner.lmtp] max_restarts: 1 -[qrunner.maildir] +[runner.maildir] max_restarts: 1 -[qrunner.news] +[runner.news] max_restarts: 1 -[qrunner.out] +[runner.out] max_restarts: 1 -[qrunner.pipeline] +[runner.pipeline] max_restarts: 1 -[qrunner.retry] +[runner.retry] max_restarts: 1 -[qrunner.shunt] +[runner.shunt] max_restarts: 1 -[qrunner.virgin] +[runner.virgin] max_restarts: 1 [archiver.prototype] |
