Wait for thread to start
This commit is contained in:
parent
0c594b0b34
commit
1b0df9c2bd
|
@ -61,6 +61,7 @@ class ExpectProcess(threading.Thread):
|
||||||
self.buffer = []
|
self.buffer = []
|
||||||
self.child_lock = threading.Lock()
|
self.child_lock = threading.Lock()
|
||||||
self.shutdown_event = threading.Event()
|
self.shutdown_event = threading.Event()
|
||||||
|
self.started_event = threading.Event()
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
with self.child_lock:
|
with self.child_lock:
|
||||||
|
@ -70,6 +71,7 @@ class ExpectProcess(threading.Thread):
|
||||||
child.setwinsize(self.dim.rows, self.dim.cols)
|
child.setwinsize(self.dim.rows, self.dim.cols)
|
||||||
sleep(0.5)
|
sleep(0.5)
|
||||||
self.child = child
|
self.child = child
|
||||||
|
self.started_event.set()
|
||||||
status = None
|
status = None
|
||||||
while status is None and not self.shutdown_event.is_set():
|
while status is None and not self.shutdown_event.is_set():
|
||||||
try:
|
try:
|
||||||
|
@ -270,6 +272,7 @@ def do_terminal_tests(tests, cmd, dim, args, env, suite, cwd=None, fin_cb=None,
|
||||||
env=env,
|
env=env,
|
||||||
)
|
)
|
||||||
p.start()
|
p.start()
|
||||||
|
p.started_event.wait()
|
||||||
|
|
||||||
ret = True
|
ret = True
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue