Пример #1
0
def test_new_worker_was_started():
    def target():
        pass

    old, new = ExceptionSafeProcess(target=target), ExceptionSafeProcess(target=target)

    assert new_worker_was_started(old, new)
    assert not new_worker_was_started(old, old)
Пример #2
0
    def check_exceptions(self):
        processes_to_check = [self.worker]
        shutdown = check_worker_exceptions(processes_to_check, 'Compare', self.config, self._compare_scheduler_main)
        if new_worker_was_started(new_process=processes_to_check[0], old_process=self.worker):
            self.worker = processes_to_check.pop()

        return shutdown
Пример #3
0
    def check_exceptions(self):
        shutdown = check_worker_exceptions(self.workers, 'Unpacking',
                                           self.config, self.unpack_worker)

        list_with_load_process = [
            self.work_load_process,
        ]
        shutdown |= check_worker_exceptions(list_with_load_process,
                                            'unpack-load', self.config,
                                            self._work_load_monitor)
        if new_worker_was_started(new_process=list_with_load_process[0],
                                  old_process=self.work_load_process):
            self.work_load_process = list_with_load_process.pop()

        return shutdown