Skip to content

Commit 81f7163

Browse files
committed
Catch non-default server start fail in app server
When test_run:cmd('start server foo') is called from an app test and tarantool fails to start, the following exception is shown: | [010] Worker "010_app-tap" received the following error; stopping... | [010] Traceback (most recent call last): | [010] File "/home/alex/projects/tarantool-meta/tarantool/test-run/lib/worker.py", line 294, in run_task | [010] task, self.server, self.inspector) | [010] File "/home/alex/projects/tarantool-meta/tarantool/test-run/lib/test_suite.py", line 208, in run_test | [010] short_status = test.run(server) | [010] File "/home/alex/projects/tarantool-meta/tarantool/test-run/lib/test.py", line 180, in run | [010] self.execute(server) | [010] File "/home/alex/projects/tarantool-meta/tarantool/test-run/lib/app_server.py", line 43, in execute | [010] tarantool.join() The commit handles this case and the exception should not be shown anymore. This commit follows the similar one for tarantool server: 7176ced ('Fix reporting of non-default server fail at start '). The reporting of such situations is not ideal for now (we show output and logs for a default server, but don't do that for non-default one), but this will be fixed in the scope of #159. Fixes #115.
1 parent d8abc03 commit 81f7163

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/app_server.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
from lib.colorer import color_log
1010
from lib.preprocessor import TestState
1111
from lib.server import Server
12-
from lib.tarantool_server import Test, TarantoolServer
12+
from lib.tarantool_server import Test
13+
from lib.tarantool_server import TarantoolServer
14+
from lib.tarantool_server import TarantoolStartError
1315
from lib.utils import find_port
1416
from lib.utils import format_process
1517
from test import TestRunGreenlet, TestExecutionError
@@ -38,9 +40,13 @@ def execute(self, server):
3840
tarantool = TestRunGreenlet(run_server, execs, server.vardir, server,
3941
server.logfile, retval)
4042
self.current_test_greenlet = tarantool
41-
tarantool.start()
4243

43-
tarantool.join()
44+
try:
45+
tarantool.start()
46+
tarantool.join()
47+
except TarantoolStartError:
48+
# A non-default server failed to start.
49+
raise TestExecutionError
4450
if retval['returncode'] != 0:
4551
raise TestExecutionError
4652

0 commit comments

Comments
 (0)