Skip to content
Commit 4c6a8fc2 authored by Yunfan Chen's avatar Yunfan Chen
Browse files

Fix OOM when running testAddRemoveRace

The test has been very likely to fail with OOM error or process crashes.
This is because we repeatedly creating ActivityRecord/ActivityStack/Task
in the test. Even though we release it after each run, the GC can still
throw OOM because of reference by mocking is not released while running
the test. After receiving several OOM's, the test process will crash.

To fix this issue, simply re-use the same ActivityRecord instead of
creating one per loop run. This works for this test as we only care
about the starting window handling inside ActivityRecord.

Test: atest AppWindowTokenTests#testAddRemoveRace
Bug: 130392471
Change-Id: I7df942d364ee07e179b05b6f837494c475197d7c
parent ec5ab8b1
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