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
Reworking tcpstreamtest #255
Conversation
Not sure similar changes (2) are needed outside of tests, I didn't hit any issues except to the test being flacky. |
Can not reproduce test failure locally :( Using TCP port 4343 for the connection test. |
Is there a way to retrieve tests/test-suite.log? |
1. There was a data race on _running In some cases _sock.down() was called before the last read was complete. That resulted in fd no longer available exception. Also, in theory the thread might never see the value flipped. 2. Binding to two sockets and reading from the one that's ready on listener thread. In some configurations connection gets closed immediately when connection via IPv4 address. Used the same approach as in API server (it must be there for a reason). Fixes issue #254. 3. Generating chars as per constructor parameter. 4. Connecting to localhost instead of 127.0.0.1, otherwise the test fails on IPv6-only systems.
Ok, pulled logs: Test name: tcpstreamtest::baseTest
There seems to be actually a bug with ibrcommon::basesocket::hasSupport() as it reports IPv6 to be available on Travis. |
The PR above is a mess. There are unnessary and possibly breaking changes ("size_t" => "int", commented out code, ...) in there. Please clean-up first and rebase your changes. I do not like commits which add stuff if it is removed again by another commit in the same PR. |
Correct, this is not ready to merge yet. I only learnt about IPv6 issue on travis upon checks in this PR, so temporary commented out code that causes it and looking for the solution. I actually read all the issues logged for Travis on this but there is no solution so far except to conditional compilation. Do you think we should go over interfaces and check availability in hasSupport()? The same code is used in ApiServer but it looks like it has no tests coverage so none a broken. In the meanwhile, can we start a review for the rest of the PR? I'd like to understand what specifically is "messy" here.
|
There was a data race on _running
In some cases _sock.down() was called before the last read was
complete. That resulted in fd no longer available exception.
Also, in theory the thread might never see the value flipped.
Binding to two sockets and reading from the one that's ready on listener thread.
In some configurations connection gets closed immediately when connection via
IPv4 address. Used the same approach as in API server (it must be there for a reason).
Fixes issue tcpsocket accepts on either IPv4 or IPv6 but not both #254.
Generating chars as per constructor parameter.
Connecting to localhost instead of 127.0.0.1, otherwise the test fails on IPv6-only systems.