TrafficStats: fix uncertainty in flushing network traffic

Flushing TCP traffic isn't reliable enough to force a packet on the socket,
even with Nagle disabled.

The kernel's socket sendto() is being invoked with 1024 bytes each time,
but something deeper in the stack is merging packets.
So now we wait 5ms between each of the 1024 packets after flushing.
This allows running the test overnight in a loop without failure
instead of only ~5 times.

The error messages are now more detailed.

Bug: 10668088
Change-Id: Ic47bec81c6dba2fad8b96eb4a41f183115c371de
1 file changed
tree: 838b75b339e74b95968f6b6e92c3fec6af4886d6
  1. tests/