Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d28ca5a6 authored by Jack He's avatar Jack He
Browse files

Cert: attach logger before checking if process is alive

* Otherwise, stdout and stderr will be missing from logs

Test: m bluetooth_stack_with_facade && gd/cert/run --clean SimpleHalTest
Bug: 307877650
Change-Id: Ia8dac6d66b1324ebcfa853b9ffd897aba46d855a
parent 3c72fe18
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -203,18 +203,21 @@ class GdDeviceBase(ABC):
            stdout=subprocess.PIPE,
            stderr=subprocess.STDOUT,
            universal_newlines=True)

        self.backing_process_logger = AsyncSubprocessLogger(
            self.backing_process, [self.backing_process_log_path],
            log_to_stdout=self.verbose_mode,
            tag=self.label,
            color=self.terminal_color)

        asserts.assert_true(
            self.backing_process, msg="[%s] failed to open backing process for %s" % (self.type_identifier, self.label))
        self.is_backing_process_alive = is_subprocess_alive(self.backing_process)

        asserts.assert_true(
            self.is_backing_process_alive,
            msg="[%s] backing process for %s died after starting" % (self.type_identifier, self.label))

        self.backing_process_logger = AsyncSubprocessLogger(
            self.backing_process, [self.backing_process_log_path],
            log_to_stdout=self.verbose_mode,
            tag=self.label,
            color=self.terminal_color)

        # If gRPC root server port is not specified, we can skip settings up the root server
        if self.grpc_root_server_port != -1: