diff options
author | Hugo Benichi <hugobenichi@google.com> | 2017-09-29 09:34:08 +0900 |
---|---|---|
committer | Hugo Benichi <hugobenichi@google.com> | 2017-10-02 17:37:57 +0900 |
commit | 893a762c2f755121cf706fd726817adb9d91212b (patch) | |
tree | 0cf47f6a61cecd327dd2152b2f02899c243b27d4 /tools/aapt2/java/JavaClassGenerator_test.cpp | |
parent | 34cf8b2c0427be2ca47c49c61d88b138ee2c784f (diff) |
ConnectivityServiceTest: fix flaky testNetworkRequestMaximum
Registered requests are not keyed by PendingIntents in
ConnectivityService, which means that unregistering a request with a
PendingIntent causes a linear search in all registered requests.
testNetworkRequestMaximum was registering too many PendingIntents
simultaneously, causing the unregistration loop to have n^2
complexity and to take a long time to take effect.
To make the unregistering loop less likely to trigger a timeout on
waitForIdle, this patch changes the test to not register MAX_REQUEST
number of PendingIntent, but instead mixes a small number of
PendingIntents with NetworkCallbacks to reach MAX_REQUEST number of
simultaneously registered requests.
When unregistering these requests, callbacks are unregistered first.
Bug: 32561414
Test: runtest frameworks-net
Change-Id: I48b882c884abe20b388190b7f28baee293446f37
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions