def start(self):
log.info('<STR_LIT>')<EOL>self.process = proc = self.enter_context(subprocess.Popen(<EOL>self.cmd,<EOL>stdin=subprocess.DEVNULL,<EOL>stdout=subprocess.PIPE,<EOL>stderr=subprocess.STDOUT,<EOL>env=self.env,<EOL>universal_newlines=True<EOL>))<EOL>msg = ('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL>if not self.keep_data:<EOL><INDENT>msg += '<STR_LIT>'<EOL><DEDENT>logfile = os.path.join(self.logs_path, self.cluster_name + '<STR_LIT>')<EOL>log.info(<EOL>msg,<EOL>proc.pid,<EOL>logfile,<EOL>self.data_path<EOL>)<EOL>self.addresses = DotDict({})<EOL>self.monitor.consumers.append(AddrConsumer(self._set_addr))<EOL>self.monitor.start(proc)<EOL>log_lines = []<EOL>self.monitor.consumers.append(log_lines.append)<EOL>spinner = cycle(['<STR_LIT:/>', '<STR_LIT:->', '<STR_LIT:\\>', '<STR_LIT:|>'])<EOL>def show_spinner():<EOL><INDENT>if sys.stdout.isatty():<EOL><INDENT>print(next(spinner), end='<STR_LIT:\r>')<EOL><DEDENT>return True<EOL><DEDENT>try:<EOL><INDENT>wait_until(<EOL>lambda: show_spinner() and _ensure_running(proc) and self.http_host,<EOL>timeout=<NUM_LIT><EOL>)<EOL>host = self.addresses.http.host<EOL>port = self.addresses.http.port<EOL>wait_until(<EOL>lambda: _ensure_running(proc) and _is_up(host, port),<EOL>timeout=<NUM_LIT:30><EOL>)<EOL>if _has_ssl(host, port):<EOL><INDENT>self.http_url = self.http_url.replace('<STR_LIT>', '<STR_LIT>')<EOL><DEDENT>wait_until(<EOL>lambda: show_spinner() and cluster_state_200(self.http_url),<EOL>timeout=<NUM_LIT:30><EOL>)<EOL><DEDENT>except (SystemError, TimeoutError):<EOL><INDENT>if not log_lines:<EOL><INDENT>_try_print_log(logfile)<EOL><DEDENT>else:<EOL><INDENT>for line in log_lines:<EOL><INDENT>log.error(line)<EOL><DEDENT><DEDENT>raise SystemExit("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>self.monitor.consumers.remove(log_lines.append)<EOL><DEDENT>log.info('<STR_LIT>')<EOL>
Start the process.

        This will block until the Crate cluster is ready to process requests.