class RunChangeStreamsInBackground(interface.Hook):
|
"""A hook to run change streams in the background."""
|
|
IS_BACKGROUND = True
|
|
def __init__(self, hook_logger, fixture):
|
"""Initialize RunChangeStreamsInBackground."""
|
description = (
|
"Run in the background full cluster change streams while a test is running."
|
" Open and close the change stream every 1..10 tests (random using config.RANDOM_SEED)."
|
)
|
interface.Hook.__init__(self, hook_logger, fixture, description)
|
self._fixture = fixture
|
self._change_streams_thread = None
|
self._test_run = None
|
random.seed(config.RANDOM_SEED)
|
self._every_n_tests = random.randint(1, 10)
|
self._full_suite_changes_num = 0
|