diff options
author | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2019-07-12 20:20:31 -0400 |
---|---|---|
committer | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2019-07-12 20:20:31 -0400 |
commit | 90ac42dc55c3ad0c3b1275dffb25d8f64b685cc4 (patch) | |
tree | 3fd6258a9d6a09c2b3634f69ef91216f82af90bf | |
parent | 86380492129440f1d150b804810207b079ee8285 (diff) | |
download | mongo-90ac42dc55c3ad0c3b1275dffb25d8f64b685cc4.tar.gz |
SERVER-42195 Create new lifecycle instance for new stepdown thread.
(cherry picked from commit eaba1b8c34eb05697112364b764921e1128a79ce)
-rw-r--r-- | buildscripts/resmokelib/testing/hooks/stepdown.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/buildscripts/resmokelib/testing/hooks/stepdown.py b/buildscripts/resmokelib/testing/hooks/stepdown.py index 94bbe2bb193..e4818aa91d9 100644 --- a/buildscripts/resmokelib/testing/hooks/stepdown.py +++ b/buildscripts/resmokelib/testing/hooks/stepdown.py @@ -66,20 +66,24 @@ class ContinuousStepdown(interface.Hook): # pylint: disable=too-many-instance-a dbpath_prefix = fixture.get_dbpath_prefix() if use_stepdown_permitted_file: - stepdown_files = StepdownFiles._make( + self.__stepdown_files = StepdownFiles._make( [os.path.join(dbpath_prefix, field) for field in StepdownFiles._fields]) - self.__lifecycle = FileBasedStepdownLifecycle(stepdown_files) else: - self.__lifecycle = FlagBasedStepdownLifecycle() + self.__stepdown_files = None def before_suite(self, test_report): """Before suite.""" if not self._rs_fixtures: self._add_fixture(self._fixture) + if self.__stepdown_files is not None: + lifecycle = FileBasedStepdownLifecycle(self.__stepdown_files) + else: + lifecycle = FlagBasedStepdownLifecycle() + self._stepdown_thread = _StepdownThread( self.logger, self._mongos_fixtures, self._rs_fixtures, self._stepdown_interval_secs, - self._terminate, self._kill, self.__lifecycle, self._wait_for_mongos_retarget) + self._terminate, self._kill, lifecycle, self._wait_for_mongos_retarget) self.logger.info("Starting the stepdown thread.") self._stepdown_thread.start() |