Closed ImeevMA closed 5 years ago
The 'Address already in use' error is likely due to the way test-run assign free ports to tarantool servers. It checks for a free port, then pass it to the tarantool via an environment variable and there is the lag between the check and actual bind. It becomes rarely and have no (known for me) ways to mitigate, because we should save the port in the tarantool_server class to connect to the server to pass lines of a test. Maybe we can read a port tarantool binds from logs and set python's variable then.
Anyway, it is not the problem of this issue. The problem is that test-run does not count the test in this case. It should be counted as failed ones.
Raw idea: choose ports via the coordinator: the main process.
Now we have use_unix_sockets_iproto
option. Setting both use_unix_sockets
and use_unix_sockets_iproto
likely will help with 'address already in use' issue. But this issue is about handling of TarantoolStartError (for default and non-default servers).
Another case:
TEST_RUN_TESTS=$(for i in $(seq 1 500); do echo -n "tarantoolctl.test.lua "; done) make test
[008] Worker "008_app-tap" received the following error; stopping...
[008] Traceback (most recent call last):
[008] File "/home/alex/projects/tarantool-meta/r/tarantool/test-run/lib/worker.py", line 291, in run_task
[008] task, self.server, self.inspector)
[008] File "/home/alex/projects/tarantool-meta/r/tarantool/test-run/lib/test_suite.py", line 207, in run_test
[008] short_status = test.run(server)
[008] File "/home/alex/projects/tarantool-meta/r/tarantool/test-run/lib/test.py", line 181, in run
[008] self.execute(server)
[008] File "/home/alex/projects/tarantool-meta/r/tarantool/test-run/lib/app_server.py", line 43, in execute
[008] tarantool.join()
[008] File "src/gevent/greenlet.py", line 661, in gevent._greenlet.Greenlet.join
[008] File "src/gevent/greenlet.py", line 687, in gevent._greenlet.Greenlet.join
[008] File "src/gevent/greenlet.py", line 676, in gevent._greenlet.Greenlet.join
[008] File "src/gevent/_greenlet_primitives.py", line 59, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch
[008] File "src/gevent/_greenlet_primitives.py", line 63, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch
[008] File "src/gevent/__greenlet_primitives.pxd", line 35, in gevent.__greenlet_primitives._greenlet_switch
[008] TarantoolStartError
[008]
[008] Exception:
Statistics:
* pass: 499
Built target test
echo $?
0
cat test/var/008_app-tap/remote.log
<...>
2019-02-18 15:23:22.934 [27133] main/101/remote tarantoolctl:541 E> Start failed: builtin/box/console.lua:560: failed to create server localhost:44152: Address already in use
Moved out 'address already in use' part into #141.
The problem should be fixed by 7176cede7a884ffc44d3a0e0bc856c9121510ba6 for 'core = tarantool' test suites. I'll propose the fix for 'core = app' tests soon.
The case with tarantoolctl.test.lua is a kinda specific: we check whether a task was reported using its ID (a test name + a configuration). When the same test runs many times; test-run is not able to detect that the test was run less times then should. It should not affect regular testing, so this part of the issue is not important.
Error:
How to reproduce:
Possible result (should pass 100):
OS: