def _run_scenario(self, cls, method, context, args):
        timeout = self.config.get("timeout", 600)
        concurrency = self.config.get("concurrency", 1)
        duration = self.config.get("duration")

        # FIXME(andreykurilin): unify `_worker_process`, use it here and remove
        #     usage of `multiprocessing.Pool`(usage of separate process for
        #     each concurrent iteration is redundant).
        pool = multiprocessing.Pool(concurrency)

        run_args = butils.infinite_run_args_generator(
            self._iter_scenario_args(cls, method, context, args, self.aborted))
        iter_result = pool.imap(_run_scenario_once_with_unpack_args, run_args)

        start = time.time()
        while True:
            try:
                result = iter_result.next(timeout)
            except multiprocessing.TimeoutError as e:
                result = runner.format_result_on_timeout(e, timeout)
            except StopIteration:
                break

            self._send_result(result)

            if time.time() - start > duration:
                break

        pool.terminate()
        pool.join()
        self._flush_results()
Jenkins One-At-A-Time Hash Function
dataset/ETHPy150Open openstack/rally/rally/plugins/common/runners/constant.py/ConstantForDurationScenarioRunner._run_scenario--crossover with--dataset/ETHPy150Open saltstack/salt/salt/executors/splay.py/SplayExecutor._get_hash