[Tarantool-patches] [PATCH] test: fix getaddrinfo test on Ubuntu 16.04

Alexander Turenko alexander.turenko at tarantool.org
Mon Mar 15 20:48:49 MSK 2021


> diff --git a/test/app/gh-4138-getaddrinfo-errors.result b/test/app/gh-4138-getaddrinfo-errors.result
> index d301e3776..62b0721df 100644
> --- a/test/app/gh-4138-getaddrinfo-errors.result
> +++ b/test/app/gh-4138-getaddrinfo-errors.result
> @@ -28,7 +28,9 @@ function check_err(err)
>  -- EAI_AGAIN
>         err == 'getaddrinfo: Temporary failure in name resolution' or
>  -- EAI_AGAIN
> -       err == 'getaddrinfo: Name could not be resolved at this time' then
> +       err == 'getaddrinfo: Name could not be resolved at this time' or
> +-- EAI_NONAME
> +       err == 'getaddrinfo: No address associated with hostname' then

It is EAI_NODATA, not EAI_NONAME:

 | $ gcc -D_GNU_SOURCE -Wall -Wextra -x c <(echo -e '#include <sys/types.h>\n#include <sys/socket.h>\n#include <netdb.h>\n#include <stdio.h>\nint main() { printf("%s\\n", gai_strerror(EAI_NONAME)); return 0; }') && ./a.out; rm a.out
 | Name or service not known
 | $ gcc -D_GNU_SOURCE -Wall -Wextra -x c <(echo -e '#include <sys/types.h>\n#include <sys/socket.h>\n#include <netdb.h>\n#include <stdio.h>\nint main() { printf("%s\\n", gai_strerror(EAI_NODATA)); return 0; }') && ./a.out; rm a.out
 | No address associated with hostname

Anyway, we meet another miscompare after updating FreeBSD from 12.0 to
12.2 (see [1]), so we finally decided to don't check exact error
messages. It appears to be too fragile: it depends on OS and network
conditions both. The patch 'test: simplify check of error message from
getaddrinfo()' from [2] will handle it.

[1]: https://github.com/tarantool/tarantool-qa/issues/94
[2]: https://github.com/tarantool/tarantool/pull/5751

WBR, Alexander Turenko.


More information about the Tarantool-patches mailing list