Example #1
0
 def setUp(self):
     params.register_param_source_for_name("driver-test-param-source",
                                           DriverTestParamSource)
     params.register_param_source_for_name(
         "driver-test-param-source-with-progress",
         DriverTestParamSourceWithProgress)
     runner.register_default_runners()
     self.test_track = track.Track(name="unittest")
Example #2
0
    def run(self):
        self.logger.info("Benchmark is about to start.")
        # ensure relative time starts when the benchmark starts.
        self.reset_relative_time()
        self.logger.info("Attaching cluster-level telemetry devices.")
        self.telemetry.on_benchmark_start()
        self.logger.info("Cluster-level telemetry devices are now attached.")

        pool = concurrent.futures.ThreadPoolExecutor(max_workers=1)

        timer = Timer()
        timer.add_task(fn=self.update_samples, interval=1)
        timer.add_task(fn=self.post_process_samples, interval=30)
        timer.add_task(fn=self.update_progress_message, interval=1)

        pool.submit(timer)

        # needed because a new thread (that is not the main thread) does not have an event loop
        loop = asyncio.new_event_loop()
        loop.set_debug(self.debug_event_loop)
        asyncio.set_event_loop(loop)
        loop.set_exception_handler(self._logging_exception_handler)

        track.set_absolute_data_path(self.config, self.track)
        runner.register_default_runners()
        # We can skip this here as long as we run in the same process; it has already been done in #setup()
        # if self.track.has_plugins:
        #     track.load_track_plugins(self.config, runner.register_runner, scheduler.register_scheduler)
        try:
            benchmark_runner = driver.AsyncProfiler(
                self._run_benchmark
            ) if self.profiling_enabled else self._run_benchmark
            loop.run_until_complete(benchmark_runner())
            self.telemetry.on_benchmark_stop()
            self.logger.info("All steps completed.")
            return self.metrics_store.to_externalizable()
        finally:
            self.logger.debug("Stopping timer...")
            timer.stop()
            pool.shutdown()
            self.logger.debug("Closing event loop...")
            loop.close()
            self.progress_reporter.finish()
            self.logger.debug("Closing metrics store...")
            self.metrics_store.close()
            # immediately clear as we don't need it anymore and it can consume a significant amount of memory
            self.metrics_store = None
Example #3
0
 def setUp(self):
     runner.register_default_runners()
Example #4
0
 def setUp(self):
     runner.register_default_runners()
     self.runner_with_progress = ExecutorTests.RunnerWithProgress()
     runner.register_runner("unit-test-recovery", self.runner_with_progress)
Example #5
0
 def setUp(self):
     self.test_track = track.Track(name="unittest")
     self.runner_with_progress = SchedulerTests.RunnerWithProgress()
     params.register_param_source_for_name("driver-test-param-source", DriverTestParamSource)
     runner.register_default_runners()
     runner.register_runner("driver-test-runner-with-completion", self.runner_with_progress)