Пример #1
0
    def test_execution_strategy_nailgun(self):
        self.set_options(
            execution_strategy=NailgunTask.ExecutionStrategy.nailgun)
        self.addCleanup(lambda: NailgunProcessGroup(metadata_base_dir=self.
                                                    subprocess_dir).killall())

        self.assert_cwd_is_buildroot(expected_source='nailMain')
Пример #2
0
    def run(self):
        should_kill_nailguns = self._kill_nailguns

        try:
            result = self._execute_engine()
            if result:
                self._run_tracker.set_root_outcome(WorkUnit.FAILURE)
        except KeyboardInterrupt:
            self._run_tracker.set_root_outcome(WorkUnit.FAILURE)
            # On ctrl-c we always kill nailguns, otherwise they might keep running
            # some heavyweight compilation and gum up the system during a subsequent run.
            should_kill_nailguns = True
            raise
        except Exception:
            self._run_tracker.set_root_outcome(WorkUnit.FAILURE)
            raise
        finally:
            self._run_tracker.end()
            # Must kill nailguns only after run_tracker.end() is called, otherwise there may still
            # be pending background work that needs a nailgun.
            if should_kill_nailguns:
                # TODO: This is JVM-specific and really doesn't belong here.
                # TODO: Make this more selective? Only kill nailguns that affect state?
                # E.g., checkstyle may not need to be killed.
                NailgunProcessGroup().killall()

        return result
Пример #3
0
 def execute(self):
     NailgunProcessGroup().killall(everywhere=self.get_options().everywhere)