Do not drop too many packages in PacketDroppingTestWriter.

After each dropped package, succeed in writing at least two packages before
dropping another one (unless fake drop percentage is 100).  This is to avoid
test flakiness due to too many dropped packages.  For example, if both the
server and the client happen to drop every other package, no probe ack will ever
be received.  See https://crbug.com/1095063 for more context.

Without this change, I can reproduce the following errors in AckNotifierWithPacketLossAndBlockedSocket tests:
- in the internal code base, test flakiness (QUIC_TOO_MANY_RTOS errors),
- in Chromium debug build, test flakiness (QUIC_TOO_MANY_RTOS errors),
- in Chromium MSAN build, both test flakiness and test timeouts.

With this change, I ran all of AckNotifierWithPacketLossAndBlockedSocket in Chromium in both setups, and all of EndToEndTests with internal tools, each of them 1000 times, and they all passed.
Test-only change

PiperOrigin-RevId: 319202623
Change-Id: I8aedcf3e790a947d3d6fa341f6064a7465156472
2 files changed
tree: ab7e2674766cbebeaa932d21c1da797d90e46f13
  1. common/
  2. epoll_server/
  3. http2/
  4. quic/
  5. spdy/
  6. CONTRIBUTING.md
  7. LICENSE
  8. README.md
README.md

QUICHE

QUICHE (QUIC, Http/2, Etc) is Google‘s implementation of QUIC and related protocols. It powers Chromium as well as Google’s QUIC servers and some other projects.