Skip to content
Commit 68eab721 authored by Chalard Jean's avatar Chalard Jean
Browse files

Apply forwarding rules before sending onAvailable

Ideally the rules should be set up before onAvailable is
sent, but onLocalNetworkChanged should be sent after.

The previous code had CSLocalAgentTests#testForwardingRules
flaky because it was waiting for onAvailable and immediately
checking that the routing rules have been set up.

There are other ways to fix this flake (e.g. wait for
onLocalNetworkChange in the test or add a timeout on
the verify(netd) call) but this patch probably implements
the best production code behavior.

Bug: 309688089
Test: CSLocalAgentTests#testForwardingRules 1'000 times
      Before this patch : flakes after 50~200 iterations
      After this patch : no flake in 1'000 iterations
Change-Id: I4dcccaa3607c1e28aa89f268f0c721d87b1e9466
parent cc2e7273
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment