Exemple #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()
 def __init__(self, destdir, persist_limit, **kwargs):
     QObject.__init__(self)
     persist_limit = PersistLimit(persist_limit)
     BuildDownloadManager.__init__(self, destdir,
                                   session=get_http_session(),
                                   persist_limit=persist_limit,
                                   **kwargs)
Exemple #3
0
 def __init__(self, destdir, persist_limit, **kwargs):
     QObject.__init__(self)
     BuildDownloadManager.__init__(self,
                                   destdir,
                                   session=get_http_session(),
                                   persist_limit=persist_limit,
                                   **kwargs)
Exemple #4
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()
 def _download_finished(self, task):
     try:
         self.download_finished.emit(task, task.get_dest())
     except RuntimeError:
         # in some cases, closing the application may destroy the
         # underlying c++ QObject, causing this signal to fail.
         # Skip this silently.
         pass
     BuildDownloadManager._download_finished(self, task)
Exemple #6
0
 def _download_finished(self, task):
     try:
         self.download_finished.emit(task, task.get_dest())
     except RuntimeError:
         # in some cases, closing the application may destroy the
         # underlying c++ QObject, causing this signal to fail.
         # Skip this silently.
         pass
     BuildDownloadManager._download_finished(self, task)
Exemple #7
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
Exemple #8
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,
            background_dl_policy=self.background_dl_policy
        )

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

        previous_verdict, previous_build_infos = None, None
        try:
            while True:
                mid = bisection.search_mid_point()
                result = bisection.init_handler(mid)
                if result != bisection.RUNNING:
                    return result
                if previous_verdict == 'r':
                    # if the last verdict was retry, do not download
                    # the build. Futhermore trying to download if we are
                    # in background download mode would stop the next builds
                    # downloads.
                    build_infos = previous_build_infos
                else:
                    mid, build_infos = bisection.download_build(mid)
                verdict, app_info = bisection.evaluate(build_infos)
                previous_verdict = verdict
                previous_build_infos = 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()
 def _download_started(self, task):
     self.download_started.emit(task)
     BuildDownloadManager._download_started(self, task)
Exemple #10
0
 def _download_started(self, task):
     self.download_started.emit(task)
     BuildDownloadManager._download_started(self, task)
Exemple #11
0
 def __init__(self, destdir, **kwargs):
     QObject.__init__(self)
     BuildDownloadManager.__init__(self, None, destdir, **kwargs)
 def __init__(self, destdir, **kwargs):
     QObject.__init__(self)
     BuildDownloadManager.__init__(self, None, destdir, **kwargs)
Exemple #13
0
 def __init__(self, destdir, **kwargs):
     QObject.__init__(self)
     BuildDownloadManager.__init__(self, None, destdir,
                                   session=get_http_session(),
                                   **kwargs)