From a03704d3c165ea028dd76b8011e91bf593fab017 Mon Sep 17 00:00:00 2001 From: VitaliyaIoffe Date: Tue, 11 May 2021 14:57:13 +0300 Subject: [PATCH] Use gevent sleep for switching context Was changed `time.sleep` to `gevent.sleep` to allow current greenlet to sleep and others to run. If it uses time.sleep() greenlet's context is not changed from the main process to test greenlet. As a result, there was no data received by the main process during hanging tarantool and the suite was fallen down by common timeout (no output timeout). Using greenlet timeout allows to fall down by test timeout. Fixes: #276 --- lib/tarantool_server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tarantool_server.py b/lib/tarantool_server.py index 8c8222ae..cd3c838f 100644 --- a/lib/tarantool_server.py +++ b/lib/tarantool_server.py @@ -449,7 +449,7 @@ def seek_wait(self, msg, proc=None, name=None): while True: if os.path.exists(self.path): break - time.sleep(0.001) + gevent.sleep(0.001) with open(self.path, 'r') as f: f.seek(self.log_begin, os.SEEK_SET) @@ -460,7 +460,7 @@ def seek_wait(self, msg, proc=None, name=None): raise TarantoolStartError(name) log_str = f.readline() if not log_str: - time.sleep(0.001) + gevent.sleep(0.001) f.seek(cur_pos, os.SEEK_SET) continue if re.findall(msg, log_str):