diff options
| author | 2023-02-04 01:12:00 +0000 | |
|---|---|---|
| committer | 2023-02-07 15:16:21 +0000 | |
| commit | 36ef8f079114f65d9a74299fd5d6ddf5251bb9eb (patch) | |
| tree | 9ae2e424cce1933288ecf8cbda6f79e9b16b2324 /libs/androidfw/ApkParsing.cpp | |
| parent | c7f6a80cbecb525db8fa7e175bd0991d65890c0d (diff) | |
Improved ExtendedMockitoTestCase to make it more error prone.
- Make sure session is properly closed, as Mockito keeps static
references to the sessions (and when one test fails to close a
session, all subsequent tests would fail).
- Clear inline mocks after each test to avoid OOM (see b/259280359
and https://github.com/mockito/mockito/issues/1614)
- Convert AlarmManagerServiceTest to extend ExtendedMockitoTestCase
- Also disabled CachedAppOptimizerTest, which was failing (without
this change and for months - b/226641572) and cannot use
ExtendedMockitoTestCase "as is" because it uses a @Rule that also
starts a mockito session.
Notice that to fully take advantage of these improvements, all
classes should extend ExtendedMockitoTestCase; this CL just changed
a few classes so the suite finishes without crashing with OOM and
UserVisibilityMediatorMUMDTest doesn't fail due to other tests not
closing the session.
NOTE: these improvements already exist on AbstractExtendedMockitoTestCase
(from android.car.test.mocks) which is what ExtendedMockitoTestCase is
based on.
Test: atest FrameworksMockingServicesTests
Fixes: 267765119
Bug: 226641572
Change-Id: I2c0abe930521d9babda90c393003d8730fa67e96
Diffstat (limited to 'libs/androidfw/ApkParsing.cpp')
0 files changed, 0 insertions, 0 deletions