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

Skip to content
Commit e3d37b50 authored by Garfield Tan's avatar Garfield Tan Committed by Wale Ogunwale
Browse files

Adopt upstream Mockito's solution to mem leak.

The upstream solution essentially disallows sharing mock between tests,
so the mock of PowerManagerWrapper is moved to SystemServicesTestRule so
that TestWindowManagerPolicy can use that to create window. It also
makes the life of PowerManagerWrapper mock the same as the
TestWindowManagerPolicy, which is used in both ActivityTestBase and
WindowTestBase but PowerManagerWrapper was only available in
WindowTestBase.

Also, Track mocks created in ActivityStarterTests#testStartActivityPreconditions
and clear them in the middle of execution because the memory usage could be
~0.8G just to run ActivityStarterTests only because of that.

Bug: 123984854
Test: "tradefed.sh run commandAndExit WmTests --include-annotation
android.platform.test.annotations.Presubmit --exclude-annotation
androidx.test.filters.FlakyTest" suffers from a lot fewer OOME.

Change-Id: I274d711fb52084d4c67547374360e373ad1e28d8
parent 8a1860a9
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