Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 25c7f49f authored by Hugo Benichi's avatar Hugo Benichi
Browse files

IpManagerTest: fix flaky test

Reset the callback mock for every onLinkPropertiesChange expected when
pushing address updates on the BaseNetworkObserver.

Bug: 32561414
Bug: 62918393
Test: runtest frameworks-net, IpManagerTest passes 200 times in a row
Change-Id: I4719b4dc86044438243887634191c2d21686b80f
parent 2a94ac55
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -180,7 +180,8 @@ public class IpManagerTest {
        // Add N - 1 addresses
        for (int i = 0; i < lastAddr; i++) {
            mObserver.addressUpdated(iface, new LinkAddress(addresses[i]));
            verify(mCb, timeout(100).times(1)).onLinkPropertiesChange(any());
            verify(mCb, timeout(100)).onLinkPropertiesChange(any());
            reset(mCb);
        }

        // Add Nth address