Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test case failure: ntcf_system.t test case 15 #9

Closed
mattrm456 opened this issue Mar 25, 2023 · 9 comments
Closed

Test case failure: ntcf_system.t test case 15 #9

mattrm456 opened this issue Mar 25, 2023 · 9 comments

Comments

@mattrm456
Copy link
Contributor

[ W ][ 24MAR2023_03:39:04.415 ][ main ][ ntcf_system.t.cpp:7160 ]: ECONNREFUSED/ETIMEDOUT (x5)
Running test case 15
[ W ][ 24MAR2023_03:39:05.117 ][ main ][ ntcf_system.t.cpp:5519 ]: Testing driver EPOLL (static)
[ W ][ 24MAR2023_03:39:05.117 ][ main ][ ntcf_system.t.cpp:7280 ]: ETIMEDOUT (x5)
[ F ][ 24MAR2023_03:39:05.134 ][ main ][ ntcf_system.t.cpp:7333 ]: Assertion failed: connectResult.event().context().error() == ntsa::Error(ntsa::Error::e_CONNECTION_TIMEOUT)
Found: Connection refused (ECONNREFUSED) (connectResult.event().context().error())
Expected: Connection timed out (ETIMEDOUT) (ntsa::Error(ntsa::Error::e_CONNECTION_TIMEOUT))
Aborted (core dumped)

@smtrfnv
Copy link
Contributor

smtrfnv commented Apr 4, 2023

For the reference: I was not able to reproduce the issue on my setup (Windows laptop with WSL2-Ubuntu 22.04). Tried both release and debug builds.

@rdilipk
Copy link

rdilipk commented Apr 4, 2023

This was originally reported by @michihenning. Perhaps he can help?

@michihenning
Copy link

This is still happening for me. Vanilla build using Ubuntu 20.04 and gcc 9.4.

Is there anything I can do to help track this down?

@smtrfnv
Copy link
Contributor

smtrfnv commented Apr 6, 2023

I've spent some time and managed to reproduce it on my system. It just happens sporadically.

@michihenning
Copy link

Nice, glad to hear it!

Please let me know if there is anything I can do on my end to help nail this down.

@smtrfnv
Copy link
Contributor

smtrfnv commented May 9, 2023

Nice, glad to hear it!

Please let me know if there is anything I can do on my end to help nail this down.

Could you please share the ouptut of these two commands?
ping 192.168.100.200
traceroute 192.168.100.200

And one more thing:
Can you please change the ip address inside void concernConnectEndpoint3 (Inside ntcf_system.t.cpp) from

    ntsa::Endpoint endpoint(
        ntsa::IpEndpoint(ntsa::Ipv4Address("192.168.100.200"), 1024));

to

    ntsa::Endpoint endpoint(
        ntsa::IpEndpoint(ntsa::Ipv4Address("240.0.0.1"), 1024));

and say whether the same issue is observed?

@michihenning
Copy link

I'm running inside a Fusion VM.

$ ping 192.168.100.200
PING 192.168.100.200 (192.168.100.200) 56(84) bytes of data.
From 10.20.22.173 icmp_seq=1 Packet filtered
From 10.20.22.173 icmp_seq=2 Packet filtered
From 10.20.22.173 icmp_seq=3 Packet filtered
From 10.20.22.173 icmp_seq=4 Packet filtered
$ traceroute 192.168.100.200
traceroute to 192.168.100.200 (192.168.100.200), 30 hops max, 60 byte packets
 1  _gateway (172.16.85.2)  0.350 ms  0.251 ms  0.204 ms
 2  10.1.5.1 (10.1.5.1)  2.768 ms  2.919 ms  2.804 ms
 3  10.20.22.173 (10.20.22.173)  9.492 ms  9.469 ms  14.158 ms
 4  10.20.22.173 (10.20.22.173)  14.078 ms !X * *

With the code change to concernConnectEndpoint3, test 15 passes.

But I'm seeing other failures, not on every run.

Test case 17:

Running test case 17
[ W ][ 10MAY2023_23:50:33.525 ][             main ][                   ntcf_system.t.cpp:5519 ]: Testing driver EPOLL (static)
[ W ][ 10MAY2023_23:50:33.527 ][             main ][                   ntcf_system.t.cpp:7529 ]: ETIMEDOUT (x4), ECANCELED
[ W ][ 10MAY2023_23:50:34.229 ][             main ][                   ntcf_system.t.cpp:5519 ]: Testing driver POLL (static)
[ W ][ 10MAY2023_23:50:34.230 ][             main ][                   ntcf_system.t.cpp:7529 ]: ETIMEDOUT (x4), ECANCELED
[ F ][ 10MAY2023_23:50:34.240 ][             main ][                   ntcf_system.t.cpp:7602 ]: Unexpected connect event [ type = ERROR context = [ endpoint = 192.168.100.200:1024 attemptsRemaining = 99 error = [ code = UNREACHABLE number = 113 description = Host is unreachable (EHOSTUNREACH) ] ] ]
[ F ][ 10MAY2023_23:50:34.240 ][             main ][                   ntcf_system.t.cpp:7603 ]: Assertion false: false
Aborted (core dumped)

Test case 14:

Running test case 14
[ W ][ 10MAY2023_23:52:14.069 ][             main ][                   ntcf_system.t.cpp:5519 ]: Testing driver EPOLL (static)
[ W ][ 10MAY2023_23:52:14.070 ][             main ][                   ntcf_system.t.cpp:7160 ]: ECONNREFUSED/ETIMEDOUT (x5)
[ W ][ 10MAY2023_23:52:14.772 ][             main ][                   ntcf_system.t.cpp:5519 ]: Testing driver POLL (static)
[ W ][ 10MAY2023_23:52:14.773 ][             main ][                   ntcf_system.t.cpp:7160 ]: ECONNREFUSED/ETIMEDOUT (x5)
[ W ][ 10MAY2023_23:52:15.474 ][             main ][                   ntcf_system.t.cpp:5519 ]: Testing driver SELECT (static)
[ W ][ 10MAY2023_23:52:15.475 ][             main ][                   ntcf_system.t.cpp:7160 ]: ECONNREFUSED/ETIMEDOUT (x5)
[ W ][ 10MAY2023_23:52:16.175 ][             main ][                   ntcf_system.t.cpp:5519 ]: Testing driver EPOLL (dynamic)
[ W ][ 10MAY2023_23:52:16.176 ][             main ][                   ntcf_system.t.cpp:7160 ]: ECONNREFUSED/ETIMEDOUT (x5)
[ W ][ 10MAY2023_23:52:16.877 ][             main ][                   ntcf_system.t.cpp:5519 ]: Testing driver POLL (dynamic)
[ W ][ 10MAY2023_23:52:16.878 ][             main ][                   ntcf_system.t.cpp:7160 ]: ECONNREFUSED/ETIMEDOUT (x5)
[ W ][ 10MAY2023_23:52:17.579 ][             main ][                   ntcf_system.t.cpp:5519 ]: Testing driver SELECT (dynamic)
[ W ][ 10MAY2023_23:52:17.579 ][             main ][                   ntcf_system.t.cpp:7160 ]: ECONNREFUSED/ETIMEDOUT (x5)
Running test case 15
[ W ][ 10MAY2023_23:52:18.281 ][             main ][                   ntcf_system.t.cpp:5519 ]: Testing driver EPOLL (static)
[ W ][ 10MAY2023_23:52:18.282 ][             main ][                   ntcf_system.t.cpp:7280 ]: ETIMEDOUT (x5)
[ F ][ 10MAY2023_23:52:18.293 ][             main ][                   ntcf_system.t.cpp:7334 ]: Assertion failed: connectResult.event().context().error() == ntsa::Error(ntsa::Error::e_CONNECTION_TIMEOUT)
Found:    Connection refused (ECONNREFUSED) (connectResult.event().context().error())
Expected: Connection timed out (ETIMEDOUT) (ntsa::Error(ntsa::Error::e_CONNECTION_TIMEOUT))
Aborted (core dumped)

After making the same change to concernConnectEndpoint5 and concernConnectEndpoint7, all tests pass.

diff --git a/groups/ntc/ntcf/ntcf_system.t.cpp b/groups/ntc/ntcf/ntcf_system.t.cpp
index 40db77b..dbf0c4c 100644
--- a/groups/ntc/ntcf/ntcf_system.t.cpp
+++ b/groups/ntc/ntcf/ntcf_system.t.cpp
@@ -7301,7 +7301,8 @@ void concernConnectEndpoint3(const bsl::shared_ptr<ntci::Interface>& interface,
     // Connect the stream socket to the listener socket.
 
     ntsa::Endpoint endpoint(
-        ntsa::IpEndpoint(ntsa::Ipv4Address("192.168.100.200"), 1024));
+        //ntsa::IpEndpoint(ntsa::Ipv4Address("192.168.100.200"), 1024));
+        ntsa::IpEndpoint(ntsa::Ipv4Address("240.0.0.1"), 1024));
 
     bsl::size_t numErrors = 0;
     NTCCFG_TEST_GT(k_MAX_CONNECTION_ATTEMPTS, 0);
@@ -7549,7 +7550,8 @@ void concernConnectEndpoint5(const bsl::shared_ptr<ntci::Interface>& interface,
     // Connect the stream socket to the listener socket.
 
     ntsa::Endpoint endpoint(
-        ntsa::IpEndpoint(ntsa::Ipv4Address("192.168.100.200"), 1024));
+        //ntsa::IpEndpoint(ntsa::Ipv4Address("192.168.100.200"), 1024));
+        ntsa::IpEndpoint(ntsa::Ipv4Address("240.0.0.1"), 1024));
 
     bsl::size_t numErrors = 0;
     NTCCFG_TEST_GT(k_MAX_CONNECTION_ATTEMPTS, 0);
@@ -7832,7 +7834,8 @@ void concernConnectEndpoint7(const bsl::shared_ptr<ntci::Interface>& interface,
     // Connect the stream socket to the listener socket.
 
     ntsa::Endpoint endpoint(
-        ntsa::IpEndpoint(ntsa::Ipv4Address("192.168.100.200"), 1024));
+        //ntsa::IpEndpoint(ntsa::Ipv4Address("192.168.100.200"), 1024));
+        ntsa::IpEndpoint(ntsa::Ipv4Address("240.0.0.1"), 1024));
 
     bsl::size_t numErrors = 0;
     NTCCFG_TEST_GT(k_MAX_CONNECTION_ATTEMPTS, 0);

@smtrfnv
Copy link
Contributor

smtrfnv commented May 12, 2023

@michihenning thank you for this! I'll update the PR to fix these errors

@smtrfnv
Copy link
Contributor

smtrfnv commented Nov 3, 2023

@mattrm456 let's close it as I think with the recent changes delivered to main the issue is resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants