Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use exact IPv4/IPv6 address in test_run:cmd()
When test-run's inspector listens on a IPv4 port and some other process listens on a IPv6 port of the same number, test_run:cmd() could connect to this process rather then the inspector, because 'localhost' hostname was used to connect. Now test-run passes actual IP address of the inspector via an environment variable and test_run:cmd() uses it to avoid the ambiguity that is described above. The problem was found during many parallel runs of app/socket.test.lua test from tarantool, see case 4 in [1] (untitled, see right under case 3). This test starts many TCP servers and in rare cases a server port may be the same as inspector's one. There are two details that increase probability of the problem: * It seems test-run's inspector always listens on IPv4 address, because it is configured with 'localhost' hostname and gevent.server.StreamServer implementation always chooses IPv4 for 'localhost' (see [2], _parse_address() function). * socket.tcp_connect() typically tries to connect to an IPv6 address first and only then to an IPv4 one, because getaddrinfo() returns addresses in this order according to RFC 3484 (see [3], section 2.1 'Policy table'). This however can be configured in /etc/gai.conf. [1]: https://lists.tarantool.org/pipermail/tarantool-patches/2019-December/013321.html [2]: https://github.com/gevent/gevent/blob/ba3b15de7eb568fa09fdf1a9d28241288163ba67/src/gevent/baseserver.py#L406-L409 [3]: https://tools.ietf.org/rfc/rfc3484.txt
- Loading branch information