baresip / re

Generic library for real-time communications with async IO support
BSD 3-Clause "New" or "Revised" License
135 stars 83 forks source link

test: test_async: test failed (Invalid argument [22]) #1164

Closed robert-scheck closed 2 months ago

robert-scheck commented 2 months ago

For the first time, I'm running test/retest from re v3.14.0 after the actual Fedora build. Unfortunately, TEST(test_async) fails in the Fedora build system like this:

+ redhat-linux-build/test/retest -d test/data/ -v -r
regular tests:       
async: TEST_EQUALS: /builddir/build/BUILD/libre-3.14.0-build/re-3.14.0/test/async.c:107: test_re_thread_async(): expected=0(0x0), actual=99(0x63)
retest: libre version 3.14.0 (x86_64/Linux)
using async polling method 'epoll'
using datapath 'test/data/'
test 0 -- test_aac
test 1 -- test_aes
test 2 -- test_aes_gcm
test 3 -- test_aubuf
test 4 -- test_aulength
test 5 -- test_aulevel
test 6 -- test_auposition
test 7 -- test_auresamp
test 8 -- test_async
async: TEST_ERR: /builddir/build/BUILD/libre-3.14.0-build/re-3.14.0/test/async.c:164: (Invalid argument [22])
test: test_async: test failed (Invalid argument [22])

retest: TEST_ERR: /builddir/build/BUILD/libre-3.14.0-build/re-3.14.0/test/main.c:238: (Invalid argument [22])

When removing this test from test/test.c, test/retest succeeds. Is there any chance to add a skip in the re source code in case a build system doesn't provide what's needed to run this test?

sreimers commented 2 months ago

Looks like a simple getaddrinfo("localhost"...); returns a error code. I wonder why? Maybe it's enough to remove the AI_ADDRCONFIG flag, this should help if there is no valid IPv4 (besides loopback) configured.

robert-scheck commented 2 months ago

Yes, the build system has no network connectivity other than loopback:

+ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host proto kernel_lo 
       valid_lft forever preferred_lft forever
+ cat /etc/resolv.conf
+ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain
::1       localhost localhost.localdomain localhost6 localhost6.localdomain6

Edit: Yes, sed -e 's/ | AI_ADDRCONFIG//' -i test/async.c lets test/retest succeed.