Skip to content

Commit

Permalink
Fix flaky Http2FloodMitigationTest.TooManyStreams test
Browse files Browse the repository at this point in the history
Signed-off-by: Yan Avlasov <yavlasov@google.com>
  • Loading branch information
yanavlasov committed Aug 18, 2020
1 parent 0a5033f commit 580d376
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/integration/http2_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1793,10 +1793,15 @@ TEST_P(Http2FloodMitigationTest, TooManyStreams) {
});
autonomous_upstream_ = true;
beginSession();
// To prevent Envoy from closing client streams the upstream connection needs to push back on
// writing by the upstream server. In this case Envoy will not see upstream responses and will
// keep client streams open, eventually maxing them out and causing client connection to be
// closed.
writev_matcher_->setSourcePort(fake_upstreams_[0]->localAddress()->ip()->port());
fake_upstreams_[0]->set_allow_unexpected_disconnects(true);

// Exceed the number of streams allowed by the server. The server should stop reading from the
// client. Verify that the client was unable to stuff a lot of data into the server.
// client.
floodServer("host", "/test/long/url", Http2Frame::ResponseStatus::Ok, "", 3);
}

Expand Down

0 comments on commit 580d376

Please sign in to comment.