Skip to content

Commit ca16be5

Browse files
committed
Show logs for a non-default server failed at start
Show logs and only then reraise TarantoolStartError (see TarantoolServer.start()). Don't show logs on an instance that acquires to start an instance, e.g. default one (see LuaTest.execute()). How to reproduce using tarantool test suite: | diff --git a/test/box/proxy.lua b/test/box/proxy.lua | index fa87ab879..a90f24715 100644 | --- a/test/box/proxy.lua | +++ b/test/box/proxy.lua | @@ -2,7 +2,7 @@ | os = require('os') | box.cfg{ | - listen = os.getenv("LISTEN"), | + listen = 3301, | memtx_memory = 107374182, | pid_file = "tarantool.pid", | rows_per_wal = 50 Hold 3301 port. Say, using tarantool: | ./src/tarantool <<< 'box.cfg{listen = 3301}' & Run a test that performs default server restarting: | cd test && ./test-run.py --conf memtx engine/snapshot.test.lua Fixes #159.
1 parent 6e278b6 commit ca16be5

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

lib/tarantool_server.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,9 @@ def execute(self, server):
160160
ts.stop_nondefault()
161161
raise
162162
except TarantoolStartError as e:
163-
if not self.is_crash_reported:
164-
self.is_crash_reported = True
165-
color_stdout('\n[Instance "{0}"] Failed to start tarantool '
166-
'server from a test\n'.format(e.name),
167-
schema='error')
168-
server.print_log(15)
163+
color_stdout('\n[Instance "{0}"] Failed to start tarantool '
164+
'instance "{1}"\n'.format(server.name, e.name),
165+
schema='error')
169166
server.kill_current_test()
170167

171168

@@ -626,10 +623,6 @@ def start(self, silent=True, wait=True, wait_load=True, rais=True, args=[],
626623
try:
627624
self.wait_until_started(wait_load)
628625
except TarantoolStartError:
629-
# Raise exception when caller ask for it (e.g. in case of
630-
# non-default servers)
631-
if rais:
632-
raise
633626
# Python tests expect we raise an exception when non-default
634627
# server fails
635628
if self.crash_expected:
@@ -642,6 +635,10 @@ def start(self, silent=True, wait=True, wait_load=True, rais=True, args=[],
642635
'failed to start\n'.format(self),
643636
schema='error')
644637
self.print_log(15)
638+
# Raise exception when caller ask for it (e.g. in case of
639+
# non-default servers)
640+
if rais:
641+
raise
645642
# if the server fails before any test started, we should inform
646643
# a caller by the exception
647644
if not self.current_test:

0 commit comments

Comments
 (0)