-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
tests(server): Add failing test to demonstrate port exhausting problem #1369
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, thanks!
What specifically is this trying to test? The description mentions a failing test, but it doesn't seem like this fails?
// Just establish the TCP connection, do nothing otherwise. | ||
let socket = tokio_core::net::TcpStream::connect(&addr, &handle); | ||
|
||
socket.then(move |_| -> Result<_, std::io::Error> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that this will drop the TcpStream
right upon connect, and so there won't actually be that many concurrent connections. I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! Not sure what we can do to keep the connection open for a bit before dropping it? Add a future that just sleeps 1 second?
This test is trying to exhaust available ports on the system to trigger an IO error which makes the server panic. This was failing for me locally, maybe the Travis VM is too slow so that the problem does not occur? I raised the number of requests to 10 million, let's see if that makes a difference. |
Yay, Travis is failing now as expected. This test is not super ideal because it has to make that many requests, but on the other hand it is a nice integration test to check if Hyper can keep up when a flood of requests arrives. The next step now is to figure out how to actually fix this and make the test pass. |
I think I have to close this because a test case like this has random fails and is not reliable. I had a similar test running in Rustnish, but removed it after failing randomly on Travis CI: klausi/rustnish@e7fcd75 Sorry! Let me know if you have better ideas how to test such an attack. |
Failing test demonstration for #1358