1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-08-06 22:22:38 +03:00

Fix time-based write limit test.

Summary: Turns out the optimized builds of this test were running too fast and getting limited by flow control first rather than the intention which was to be limited by the time limit. Fix this by unlimiting them on flow control and giving some more headroom to hit the time limit.

Reviewed By: lnicco

Differential Revision: D32599440

fbshipit-source-id: 1ab2b15661cecdb44a62e3ca6048dc8424cceb1e
This commit is contained in:
Matt Joras
2021-11-22 13:31:43 -08:00
committed by Facebook GitHub Bot
parent 3514418680
commit a4c8583f91

View File

@@ -165,13 +165,13 @@ class QuicTransportFunctionsTest : public Test {
conn->clientConnectionId = getTestConnectionId();
conn->version = QuicVersion::MVFST;
conn->flowControlState.peerAdvertisedInitialMaxStreamOffsetBidiLocal =
kDefaultStreamWindowSize;
kDefaultStreamWindowSize * 1000;
conn->flowControlState.peerAdvertisedInitialMaxStreamOffsetBidiRemote =
kDefaultStreamWindowSize;
kDefaultStreamWindowSize * 1000;
conn->flowControlState.peerAdvertisedInitialMaxStreamOffsetUni =
kDefaultStreamWindowSize;
kDefaultStreamWindowSize * 1000;
conn->flowControlState.peerAdvertisedMaxOffset =
kDefaultConnectionWindowSize;
kDefaultConnectionWindowSize * 1000;
conn->statsCallback = transportInfoCb_.get();
conn->initialWriteCipher = createNoOpAead();
conn->initialHeaderCipher = createNoOpHeaderCipher();
@@ -3167,7 +3167,7 @@ TEST_F(QuicTransportFunctionsTest, TimeoutBasedRetxCountUpdate) {
TEST_F(QuicTransportFunctionsTest, WriteLimitBytRttFraction) {
auto conn = createConn();
conn->lossState.srtt = 150ms;
conn->lossState.srtt = 50ms;
auto mockCongestionController =
std::make_unique<NiceMock<MockCongestionController>>();
auto rawCongestionController = mockCongestionController.get();
@@ -3180,7 +3180,7 @@ TEST_F(QuicTransportFunctionsTest, WriteLimitBytRttFraction) {
auto rawSocket = socket.get();
auto stream1 = conn->streamManager->createNextBidirectionalStream().value();
auto buf = buildRandomInputData(2048 * 1024);
auto buf = buildRandomInputData(2048 * 2048);
writeDataToQuicStream(*stream1, buf->clone(), true);
EXPECT_CALL(*rawSocket, write(_, _)).WillRepeatedly(Return(1));
@@ -3195,10 +3195,10 @@ TEST_F(QuicTransportFunctionsTest, WriteLimitBytRttFraction) {
*aead,
*headerCipher,
getVersion(*conn),
500 /* packetLimit */,
1000 /* packetLimit */,
writeLoopBeginTime);
EXPECT_GT(500, res.packetsWritten);
EXPECT_GT(1000, res.packetsWritten);
EXPECT_EQ(res.probesWritten, 0);
res = writeQuicDataToSocket(
@@ -3209,7 +3209,7 @@ TEST_F(QuicTransportFunctionsTest, WriteLimitBytRttFraction) {
*aead,
*headerCipher,
getVersion(*conn),
500 /* packetLimit */,
1000 /* packetLimit */,
writeLoopBeginTime);
EXPECT_EQ(
conn->transportSettings.writeConnectionDataPacketsLimit,