Merge "Detect and fix resource leakages in tests" am: 1151f73cc6 am: 9ff830a4ac
am: 33da92fc22

Change-Id: I84d03801f7df238de6687174d0df6b8db9738ffc