Exemplo n.º 1
0
    def _bisect(self, handler, build_data):
        """
        Starts a bisection for a :class:`mozregression.build_data.BuildData`.
        """
        download_manager = BuildDownloadManager(handler._logger,
                                                self.download_dir)

        bisection = Bisection(handler,
                              build_data,
                              download_manager,
                              self.test_runner,
                              self.fetch_config,
                              dl_in_background=self.dl_in_background)

        try:
            while True:
                mid = bisection.search_mid_point()
                result = bisection.init_handler(mid)
                if result != bisection.RUNNING:
                    return result

                mid, build_infos = bisection.download_build(mid)
                verdict, app_info = bisection.evaluate(build_infos)
                bisection.update_build_info(mid, app_info)
                result = bisection.handle_verdict(mid, verdict)
                if result != bisection.RUNNING:
                    return result
        finally:
            # ensure we cancel any possible download done in the background
            # else python will block until threads termination.
            download_manager.cancel()
Exemplo n.º 2
0
 def build_download_manager(self):
     if self._build_download_manager is None:
         background_dl_policy = self.options.background_dl_policy
         if not self.options.persist:
             # cancel background downloads forced
             background_dl_policy = "cancel"
         self._build_download_manager = BuildDownloadManager(
             self._download_dir,
             background_dl_policy=background_dl_policy,
             persist_limit=PersistLimit(self.options.persist_size_limit))
     return self._build_download_manager