Fix flaky tests caused by WeakReference

Change-Id: I287195a37aeb0ff781420c2839ffff0391942f76
Fixes: 71867776
Test: robotest
3 files changed