Ejemplo n.º 1
0
    def start(self):
        """Start the process and the logger pipes for its stdout and stderr."""
        logger = get_logger_config(group_id=self.job_num,
                                   test_id=self.test_id,
                                   process_name=self.args[0])
        output_opts = self.pb.OutputOptions(loggers=[logger])
        create_options = self.pb.CreateOptions(
            args=self.args,
            environment=self.env,
            override_environ=True,
            timeout_seconds=0,
            output=output_opts,
        )

        val = self._stub.Create(create_options)
        self.pid = val.pid
        self._id = self.pb.JasperProcessID(value=val.id)
        self._return_code = None
Ejemplo n.º 2
0
    def start(self):
        """Start the process and the logger pipes for its stdout and stderr."""
        # Add current timestamp to process name since processes may restart
        # within a job.
        process_name = "{}-{}".format(self.args[0], time.monotonic())
        logger = get_logger_config(group_id=self.job_num, test_id=self.test_id,
                                   process_name=process_name, prefix=self.logger.name)
        output_opts = self.pb.OutputOptions(loggers=[logger])
        create_options = self.pb.CreateOptions(
            args=self.args,
            environment=self.env,
            override_environ=True,
            timeout_seconds=0,
            output=output_opts,
        )

        val = self._stub.Create(create_options)
        self.pid = val.pid
        self._id = self.pb.JasperProcessID(value=val.id)
        self._return_code = None