74fbc395f1bff78051d7c12257fa697a453d7e35 |
|
26-Jul-2016 |
Roshan Pius <rpius@google.com> |
binder_dispatcher: Prevent test flakes Loopers & binder fd instances are sticky on a given thread. So, every test with a new instance of |BinderDispatcher| still share the same looper & fd instances which could lead to potential leakage of events across tests. Changes in the CL: 1. Stop using |PostDelayed| task to enforce the wait timeout. This could leave behind a stale message which might affect any future tests. So, revert back to the original design of processing each event and then checking if the |elapsed_time| has crossed over the |timeout|. 2. In the destructor of |BinderDispatcher|, destroy the |ProcessState| instance to trigger cleanup of the binder driver. While there, Flip the |needs_init| flag usage to correctly reflect the name of the variable. BUG: 30122642 Change-Id: I1960dfc782c6b93dcb591964b5b6cc9a984a536a TEST: All tests run successfully.
/system/connectivity/wificond/tests/integration/binder_dispatcher.cpp
|