Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1725)

Unified Diff: net/tools/quic/end_to_end_test.cc

Issue 661423005: Fix test which times out when FLAGS_quic_allow_more_open_streams is (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Restoring_tests_incorrectly_removed_77791119
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_session_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/end_to_end_test.cc
diff --git a/net/tools/quic/end_to_end_test.cc b/net/tools/quic/end_to_end_test.cc
index 9ce1cc119a9a78295e47efb8444134082699705f..edcd0ce416ffb1bf25610183172e98160489339a 100644
--- a/net/tools/quic/end_to_end_test.cc
+++ b/net/tools/quic/end_to_end_test.cc
@@ -854,22 +854,27 @@ TEST_P(EndToEndTest, Timeout) {
}
TEST_P(EndToEndTest, NegotiateMaxOpenStreams) {
+ ValueRestore<bool> old_flag(&FLAGS_quic_allow_more_open_streams, true);
+
// Negotiate 1 max open stream.
client_config_.SetMaxStreamsPerConnection(1, 1);
ASSERT_TRUE(Initialize());
client_->client()->WaitForCryptoHandshakeConfirmed();
// Make the client misbehave after negotiation.
- QuicSessionPeer::SetMaxOpenStreams(client_->client()->session(), 10);
+ const int kServerMaxStreams = kMaxStreamsMinimumIncrement + 1;
+ QuicSessionPeer::SetMaxOpenStreams(client_->client()->session(),
+ kServerMaxStreams + 1);
- HTTPMessage request(HttpConstants::HTTP_1_1,
- HttpConstants::POST, "/foo");
+ HTTPMessage request(HttpConstants::HTTP_1_1, HttpConstants::POST, "/foo");
request.AddHeader("content-length", "3");
request.set_has_complete_message(false);
- // Open two simultaneous streams.
- client_->SendMessage(request);
- client_->SendMessage(request);
+ // The server supports a small number of additional streams beyond the
+ // negotiated limit. Open enough streams to go beyond that limit.
+ for (int i = 0; i < kServerMaxStreams + 1; ++i) {
+ client_->SendMessage(request);
+ }
client_->WaitForResponse();
EXPECT_FALSE(client_->connected());
« no previous file with comments | « net/quic/quic_session_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698