Attempt to fix NetworkTracePollerTest flake
The test has flaked twice, once reporting only half of the packets, the second time reporting no packets. Although I haven't been able to repro this locally with 500 attempts, I believe it's a race between the kernel thread writing and test thread receiving the events. This adds a retry with a brief sleep only if we don't get all packets on the first try. This also records all unmatched packets in case something like the port or uid reporting breaks. Rather than fail saying zero packets, you'll see the ones we skipped and can (hopefully) tell what went wrong. Bug: 273600719 Test: atest libnetworkstats_test Change-Id: Iee21f30a8dc59be5649f8e8b6509f4cc69ae5ff9
Loading
Please register or sign in to comment