Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show a log file for a non-default instance that has been failed at start #159

Closed
Totktonada opened this issue Apr 12, 2019 · 2 comments · Fixed by #168
Closed

Show a log file for a non-default instance that has been failed at start #159

Totktonada opened this issue Apr 12, 2019 · 2 comments · Fixed by #168
Labels
feature A new functionality

Comments

@Totktonada
Copy link
Member

Now test-run says 'Failed to start tarantool server from a test' when fails to start a non-default server, but doesn't show a log file for the failed instance. AFAIR, test-run checks whether it already report a fail for a particular test to refrain producing much output, so we need to show a log file and mark a test as already reported one.

@Totktonada Totktonada added the feature A new functionality label Apr 12, 2019
@Totktonada
Copy link
Member Author

It seems that it would be better to catch TarantoolStartError right in TestState.server_start() (or even in TarantoolServer.start()?), report an error here and mark the error as reported one.

Totktonada added a commit that referenced this issue Apr 17, 2019
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.
Totktonada added a commit that referenced this issue Apr 30, 2019
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.
@Totktonada
Copy link
Member Author

It also worth to see whether it can lead to 'test-run internal error'. I see something like here: https://travis-ci.org/tarantool/tarantool/jobs/526418969#L3354

Totktonada added a commit that referenced this issue May 15, 2019
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.
Totktonada added a commit that referenced this issue May 15, 2019
Tests are dispatched to task queue dispatchers at start and so it is
normal that tests can be not consumed when a test fails in non-force
mode or when a test hung. It is not test-run error.

The problem part with a failed (not hung) test was introduced in
d8abc03 ('Fail testing when test-run
fails internally').

Reported in
#159 (comment)
Totktonada added a commit that referenced this issue May 15, 2019
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.
Totktonada added a commit that referenced this issue May 15, 2019
Tests are dispatched to task queue dispatchers at start and so it is
normal that tests can be not consumed when a test fails in non-force
mode or when a test hung. It is not test-run error.

The problem part with a failed (not hung) test was introduced in
d8abc03 ('Fail testing when test-run
fails internally').

Reported in
#159 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant