Skip to content

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

Closed
wants to merge 5 commits into from

Conversation

klausi
Copy link
Contributor

@klausi klausi commented Nov 4, 2017

Failing test demonstration for #1358

Copy link
Member

@seanmonstar seanmonstar left a 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> {
Copy link
Member

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.

Copy link
Contributor Author

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?

@klausi
Copy link
Contributor Author

klausi commented Nov 7, 2017

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.

@klausi
Copy link
Contributor Author

klausi commented Dec 3, 2017

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.

@klausi
Copy link
Contributor Author

klausi commented Jan 7, 2018

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.

@klausi klausi closed this Jan 7, 2018
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

Successfully merging this pull request may close these issues.

2 participants