Beispiel #1
0
  def test_clean_exit(self):
    manager.manager_prepare()

    for p in ALL_PROCESSES:
      managed_processes[p].start()

    time.sleep(10)

    for p in reversed(ALL_PROCESSES):
      state = managed_processes[p].get_process_state_msg()
      self.assertTrue(state.running, f"{p} not running")

      exit_code = managed_processes[p].stop(retry=False)
      if (p == 'ui') or (EON and p == 'logcatd'):
        # TODO: make Qt UI exit gracefully
        continue

      # Make sure the process is actually dead
      managed_processes[p].stop()

      # TODO: interrupted blocking read exits with 1 in cereal. use a more unique return code
      exit_codes = [0, 1]
      if managed_processes[p].sigkill:
        exit_codes = [-signal.SIGKILL]
      assert exit_code in exit_codes, f"{p} died with {exit_code}"
Beispiel #2
0
    def test_clean_exit(self):
        """
      Ensure all processes exit cleanly when stopped.
    """
        HARDWARE.set_power_save(False)
        manager.manager_prepare()
        for p in ALL_PROCESSES:
            managed_processes[p].start()

        time.sleep(10)

        for p in reversed(ALL_PROCESSES):
            with self.subTest(proc=p):
                state = managed_processes[p].get_process_state_msg()
                self.assertTrue(state.running, f"{p} not running")
                exit_code = managed_processes[p].stop(retry=False)

                self.assertTrue(exit_code is not None, f"{p} failed to exit")

                # TODO: interrupted blocking read exits with 1 in cereal. use a more unique return code
                exit_codes = [0, 1]
                if managed_processes[p].sigkill:
                    exit_codes = [-signal.SIGKILL]
                self.assertIn(exit_code, exit_codes,
                              f"{p} died with {exit_code}")
Beispiel #3
0
    def test_clean_exit(self):
        HARDWARE.set_power_save(False)
        manager.manager_prepare()
        for p in ALL_PROCESSES:
            managed_processes[p].start()

        time.sleep(10)

        for p in reversed(ALL_PROCESSES):
            state = managed_processes[p].get_process_state_msg()
            self.assertTrue(state.running, f"{p} not running")

            exit_code = managed_processes[p].stop(retry=False)
            if (AGNOS and p in [
                    'ui',
            ]):
                # TODO: make Qt UI exit gracefully
                continue

            # TODO: interrupted blocking read exits with 1 in cereal. use a more unique return code
            exit_codes = [0, 1]
            if managed_processes[p].sigkill:
                exit_codes = [-signal.SIGKILL]
            assert exit_code in exit_codes, f"{p} died with {exit_code}"