project-chip / connectedhomeip

Matter (formerly Project CHIP) creates more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.
https://buildwithmatter.com
Apache License 2.0
7.5k stars 2.01k forks source link

Various inet tests fail in a Linux container on Mac #2922

Open bzbarsky-apple opened 4 years ago

bzbarsky-apple commented 4 years ago

Problem

https://github.com/project-chip/connectedhomeip/pull/2725 disabled TestInetLayerDNS on Mac, but I get the same failure when running in a Linux Docker container on a Mac host, along with others. Specifically, I followed the following steps to reproduce:

% git clone https://github.com/project-chip/connectedhomeip.git
% cd connectedhomeip
% git submodule update --init
% ./integrations/docker/images/chip-build-nrf-platform/run.sh -- bash ./gn_build.sh

and the output I get is:

Output: ``` [16/2611] ACTION //src/inet/tests:TestInetEndPoint_run(//build/toolchain/host:linux_x64_clang) FAILED: linux_x64_clang/gen/src/inet/tests/TestInetEndPoint_run.pw_pystamp python ../../third_party/pigweed/repo/pw_build/py/pw_build/python_runner.py --gn-root /Users/bzbarsky/linux-connectedhomeip/ --current-path /Users/bzbarsky/linux-connectedhomeip/src/inet/tests --default-toolchain=//third_party/pigweed/repo/pw_toolchain/dummy:dummy --current-toolchain=//build/toolchain/host:linux_x64_clang --touch /Users/bzbarsky/linux-connectedhomeip/out/debug/linux_x64_clang/gen/src/inet/tests/TestInetEndPoint_run.pw_pystamp --capture-output -- /Users/bzbarsky/linux-connectedhomeip/third_party/pigweed/repo/pw_unit_test/py/pw_unit_test/test_runner.py --runner ../../third_party/pigweed/repo/targets/host/run_test --test linux_x64_clang/tests/TestInetEndPoint INF Test 1/1: [ RUN] TestInetEndPoint ERR ../../third_party/pigweed/repo/targets/host/run_test exited with status 255 OUT [457] '#0:','inet-endpoint' '#2:','Setup ','PASSED' '#3:','InetEndPoint::PreTest ','PASSED' CHIP node ready to service events; PID: 462; PPID: 457 CHIP:IN: Async DNS worker thread woke up. CHIP:IN: Posting DNS completion event to CHIP thread. DNS name resolution complete: 172.217.11.36 DNS name resolution complete: 127.0.0.1 CHIP:IN: Async DNS worker thread woke up. CHIP:IN: Posting DNS completion event to CHIP thread. DNS name resolution return no addresses '#3:','InetEndPoint::ResolveHostAddress','PASSED' '#3:','InetEndPoint::TestParseHost ','PASSED' '#3:','InetEndPoint::TestInetError ','PASSED' Interfaces: interface id: 0x1, interface name: lo, interface state: UP, no multicast, no broadcast addr interface id: 0x2, interface name: tunl0, interface state: DOWN, no multicast, no broadcast addr interface id: 0x3, interface name: ip6tnl0, interface state: DOWN, no multicast, no broadcast addr interface id: 0x84, interface name: eth0, interface state: UP, supports multicast, has broadcast addr Addresses: 127.0.0.1/8, interface id: 0x1, interface name: lo, interface state: UP, no multicast, no broadcast addr 172.17.0.2/16, interface id: 0x84, interface name: eth0, interface state: UP, supports multicast, has broadcast addr '#3:','InetEndPoint::TestInetInterface ','PASSED' ../../src/inet/tests/TestInetEndPoint.cpp:346: assertion failed: "err == INET_ERROR_WRONG_ADDRESS_TYPE" ../../src/inet/tests/TestInetEndPoint.cpp:357: assertion failed: "(err == INET_NO_ERROR) || (err == System::MapErrorPOSIX(EPERM))" ../../src/inet/tests/TestInetEndPoint.cpp:364: assertion failed: "(didBind && (err == INET_NO_ERROR)) || (!didBind && (err == INET_ERROR_INCORRECT_STATE))" ../../src/inet/tests/TestInetEndPoint.cpp:371: assertion failed: "(didBind && didListen && (err == INET_NO_ERROR)) || (!didBind && (err == INET_ERROR_INCORRECT_STATE))" ../../src/inet/tests/TestInetEndPoint.cpp:394: assertion failed: "addr.Type() == kIPAddressType_IPv6" ../../src/inet/tests/TestInetEndPoint.cpp:410: assertion failed: "err == INET_ERROR_WRONG_ADDRESS_TYPE" ../../src/inet/tests/TestInetEndPoint.cpp:458: assertion failed: "err == INET_ERROR_WRONG_ADDRESS_TYPE" ../../src/inet/tests/TestInetEndPoint.cpp:461: assertion failed: "err == INET_ERROR_WRONG_ADDRESS_TYPE" '#3:','InetEndPoint::TestInetEndPoint ','FAILED' CHIP:IN: Raw endpoint pool FULL CHIP:IN: Raw endpoint pool FULL CHIP:IN: UDP endpoint pool FULL CHIP:IN: TCP endpoint pool FULL CHIP:IN: TCP endpoint pool FULL CHIP:CSL: Timer pool EMPTY CHIP:CSL: Timer pool EMPTY CHIP:IN: Async DNS worker thread woke up. CHIP:IN: Async DNS worker thread exiting. CHIP:IN: Async DNS worker thread woke up. CHIP:IN: Async DNS worker thread exiting. '#3:','InetEndPoint::TestEndPointLimit ','PASSED' '#4:','Teardown ','PASSED' '#6:','1','7' '#7:','8','114' INF Test 1/1: [FAIL] TestInetEndPoint [17/2611] ACTION //src/lib/support/tests:TestCHIPArgParser_run(//build/toolchain/host:linux_x64_clang) [18/2611] ACTION //src/lib/support/tests:TestErrorStr_run(//build/toolchain/host:linux_x64_clang) [19/2611] ACTION //src/lib/support/tests:TestCHIPMem_run(//build/toolchain/host:linux_x64_clang) [20/2611] ACTION //src/lib/support/tests:TestBufBound_run(//build/toolchain/host:linux_x64_clang) [21/2611] ACTION //src/lib/support/tests:TestCHIPCounter_run(//build/toolchain/host:linux_x64_clang) [22/2611] ACTION //src/crypto/tests:CHIPCryptoPALTest_run(//build/toolchain/host:linux_x64_clang) [23/2611] ACTION //src/lib/support/tests:TestPersistedCounter_run(//build/toolchain/host:linux_x64_clang) [24/2611] ACTION //src/lib/support/tests:TestTimeUtils_run(//build/toolchain/host:linux_x64_clang) [25/2611] ACTION //src/inet/tests:TestInetLayerDNS_run(//build/toolchain/host:linux_x64_clang) FAILED: linux_x64_clang/gen/src/inet/tests/TestInetLayerDNS_run.pw_pystamp python ../../third_party/pigweed/repo/pw_build/py/pw_build/python_runner.py --gn-root /Users/bzbarsky/linux-connectedhomeip/ --current-path /Users/bzbarsky/linux-connectedhomeip/src/inet/tests --default-toolchain=//third_party/pigweed/repo/pw_toolchain/dummy:dummy --current-toolchain=//build/toolchain/host:linux_x64_clang --touch /Users/bzbarsky/linux-connectedhomeip/out/debug/linux_x64_clang/gen/src/inet/tests/TestInetLayerDNS_run.pw_pystamp --capture-output -- /Users/bzbarsky/linux-connectedhomeip/third_party/pigweed/repo/pw_unit_test/py/pw_unit_test/test_runner.py --runner ../../third_party/pigweed/repo/targets/host/run_test --test linux_x64_clang/tests/TestInetLayerDNS INF Test 1/1: [ RUN] TestInetLayerDNS ERR ../../third_party/pigweed/repo/targets/host/run_test exited with status 252 OUT [458] '#0:','DNS' Resolving hostname ipv4.google.com CHIP node ready to service events; PID: 461; PPID: 458 CHIP:IN: Async DNS worker thread woke up. CHIP:IN: Posting DNS completion event to CHIP thread. DNS resolution complete for ipv4.google.com: 3 results returned 142.250.64.78 142.250.64.78 142.250.64.78 Resolving hostname ipv6.google.com CHIP:IN: Async DNS worker thread woke up. CHIP:IN: Posting DNS completion event to CHIP thread. DNS resolution complete for ipv6.google.com: Inet Error 1009 (0x000003F1): Host not found ../../src/inet/tests/TestInetLayerDNS.cpp:567: assertion failed: "err == testCase.expectErr" Resolving hostname google.com CHIP:IN: Async DNS worker thread woke up. CHIP:IN: Posting DNS completion event to CHIP thread. DNS resolution complete for google.com: 3 results returned 172.217.10.142 172.217.10.142 172.217.10.142 ../../src/inet/tests/TestInetLayerDNS.cpp:601: assertion failed: "respContainsIPv6Addrs" '#3:','TestDNSResolution:Basic ','FAILED' Resolving hostname google.com CHIP:IN: Async DNS worker thread woke up. CHIP:IN: Posting DNS completion event to CHIP thread. DNS resolution complete for google.com: 3 results returned 172.217.10.142 172.217.10.142 172.217.10.142 Resolving hostname google.com CHIP:IN: Async DNS worker thread woke up. CHIP:IN: Posting DNS completion event to CHIP thread. DNS resolution complete for google.com: Inet Error 1009 (0x000003F1): Host not found ../../src/inet/tests/TestInetLayerDNS.cpp:567: assertion failed: "err == testCase.expectErr" Resolving hostname google.com CHIP:IN: Async DNS worker thread woke up. CHIP:IN: Posting DNS completion event to CHIP thread. DNS resolution complete for google.com: 3 results returned 172.217.10.142 172.217.10.142 172.217.10.142 ../../src/inet/tests/TestInetLayerDNS.cpp:601: assertion failed: "respContainsIPv6Addrs" Resolving hostname google.com CHIP:IN: Async DNS worker thread woke up. CHIP:IN: Posting DNS completion event to CHIP thread. DNS resolution complete for google.com: 3 results returned 172.217.10.142 172.217.10.142 172.217.10.142 ../../src/inet/tests/TestInetLayerDNS.cpp:601: assertion failed: "respContainsIPv6Addrs" '#3:','TestDNSResolution:AddressTypeOption','FAILED' Resolving hostname google.com CHIP:IN: Async DNS worker thread woke up. CHIP:IN: Posting DNS completion event to CHIP thread. DNS resolution complete for google.com: 2 results returned 172.217.10.142 172.217.10.142 Resolving hostname google.com CHIP:IN: Async DNS worker thread woke up. CHIP:IN: Posting DNS completion event to CHIP thread. DNS resolution complete for google.com: Inet Error 1009 (0x000003F1): Host not found ../../src/inet/tests/TestInetLayerDNS.cpp:567: assertion failed: "err == testCase.expectErr" Resolving hostname google.com CHIP:IN: Async DNS worker thread woke up. CHIP:IN: Posting DNS completion event to CHIP thread. DNS resolution complete for google.com: 2 results returned 172.217.10.142 172.217.10.142 ../../src/inet/tests/TestInetLayerDNS.cpp:601: assertion failed: "respContainsIPv6Addrs" Resolving hostname google.com CHIP:IN: Async DNS worker thread woke up. CHIP:IN: Posting DNS completion event to CHIP thread. DNS resolution complete for google.com: 2 results returned 172.217.10.142 172.217.10.142 ../../src/inet/tests/TestInetLayerDNS.cpp:601: assertion failed: "respContainsIPv6Addrs" '#3:','TestDNSResolution:RestrictedResults','FAILED' Resolving hostname 216.58.194.174 DNS resolution complete for 216.58.194.174: 1 result returned 216.58.194.174 Resolving hostname 2607:f8b0:4005:804::200e DNS resolution complete for 2607:f8b0:4005:804::200e: 1 result returned 2607:f8b0:4005:804::200e Resolving hostname 216.58.194.174 DNS resolution complete for 216.58.194.174: Inet Error 1027 (0x00000403): Incompatible IP address type Resolving hostname 2607:f8b0:4005:804::200e DNS resolution complete for 2607:f8b0:4005:804::200e: Inet Error 1027 (0x00000403): Incompatible IP address type '#3:','TestDNSResolution:TextForm ','PASSED' Resolving hostname www.google.invalid. CHIP:IN: Async DNS worker thread woke up. CHIP:IN: Posting DNS completion event to CHIP thread. DNS resolution complete for www.google.invalid.: Inet Error 1009 (0x000003F1): Host not found '#3:','TestDNSResolution:NoRecord ','PASSED' Resolving hostname _spf.google.com CHIP:IN: Async DNS worker thread woke up. CHIP:IN: Posting DNS completion event to CHIP thread. DNS resolution complete for _spf.google.com: Inet Error 1009 (0x000003F1): Host not found Resolving hostname ipv6.google.com CHIP:IN: Async DNS worker thread woke up. CHIP:IN: Posting DNS completion event to CHIP thread. DNS resolution complete for ipv6.google.com: Inet Error 1009 (0x000003F1): Host not found Resolving hostname ipv4.google.com CHIP:IN: Async DNS worker thread woke up. CHIP:IN: Posting DNS completion event to CHIP thread. DNS resolution complete for ipv4.google.com: Inet Error 1009 (0x000003F1): Host not found '#3:','TestDNSResolution:NoHostRecord ','PASSED' Resolving hostname www.google.com CHIP:IN: Async DNS worker thread woke up. CHIP:IN: Posting DNS completion event to CHIP thread. '#3:','TestDNSResolution:Cancel ','PASSED' Resolving hostname www.nest.com Resolving hostname 10.0.0.1 DNS resolution complete for 10.0.0.1: 1 result returned 10.0.0.1 Resolving hostname www.google.com Resolving hostname pool.ntp.org CHIP:IN: Async DNS worker thread woke up. CHIP:IN: Async DNS worker thread woke up. CHIP:IN: Posting DNS completion event to CHIP thread. CHIP:IN: Async DNS worker thread woke up. DNS resolution complete for www.google.com: 3 results returned 172.217.11.36 172.217.11.36 172.217.11.36 ../../src/inet/tests/TestInetLayerDNS.cpp:601: assertion failed: "respContainsIPv6Addrs" CHIP:IN: Posting DNS completion event to CHIP thread. DNS resolution complete for pool.ntp.org: 12 results returned 50.205.244.110 50.205.244.110 50.205.244.110 45.76.244.193 45.76.244.193 45.76.244.193 162.159.200.1 162.159.200.1 162.159.200.1 138.68.19.10 138.68.19.10 138.68.19.10 CHIP:IN: Posting DNS completion event to CHIP thread. DNS resolution complete for www.nest.com: 3 results returned 35.241.20.76 35.241.20.76 35.241.20.76 '#3:','TestDNSResolution:Simultaneous ','FAILED' CHIP:IN: Async DNS worker thread woke up. CHIP:IN: Async DNS worker thread exiting. CHIP:IN: Async DNS worker thread woke up. CHIP:IN: Async DNS worker thread exiting. '#6:','4','8' '#7:','9','102' INF Test 1/1: [FAIL] TestInetLayerDNS ninja: build stopped: subcommand failed. ```

Proposed Solution

Would be good to understand whether this is a bug in something I am doing, or in the way the container is set up, or in the tests...

@mspang @yunhanw-google

issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.96. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

bzbarsky-apple commented 3 years ago

This is still happening.

holbrookt commented 2 years ago

@bzbarsky-apple does this need to be fixed for 1.0?

bzbarsky-apple commented 2 years ago

I don't know. It means we don't have test coverage from those tests on Mac, but how valuable the tests are.... no idea.

woody-apple commented 2 years ago

Not clearly required for v1.0, moving to V1.X

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.