MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / _start_process

Method _start_process

tests/disposableredis/__init__.py:82–116  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

80 return '' if REDIS_SHOW_OUTPUT else self.process.stdout.read()
81
82 def _start_process(self):
83 if self._is_external:
84 return
85
86 if REDIS_DEBUGGER:
87 debugger = REDIS_DEBUGGER.split()
88 args = debugger + self.args
89 else:
90 args = self.args
91 stdout = None if REDIS_SHOW_OUTPUT else subprocess.PIPE
92 if REDIS_SHOW_OUTPUT:
93 sys.stderr.write("Executing: {}".format(repr(args)))
94 self.process = subprocess.Popen(
95 args,
96 stdin=sys.stdin,
97 stdout=stdout,
98 # stderr=sys.stderr,
99 )
100
101 begin = time.time()
102 while True:
103 try:
104 self.client().ping()
105 break
106 except (redis.ConnectionError, redis.ResponseError):
107 self.process.poll()
108 if self.process.returncode is not None:
109 raise RuntimeError(
110 "Process has exited with code {}\n. Redis output: {}"
111 .format(self.process.returncode, self._get_output()))
112
113 if time.time() - begin > 300:
114 raise RuntimeError('Cannot initialize client (waited 5mins)')
115
116 time.sleep(0.1)
117
118 def start(self):
119 """

Callers 1

startMethod · 0.95

Calls 2

clientMethod · 0.95
_get_outputMethod · 0.95

Tested by

no test coverage detected