Merge "Protect mock with lock to fix flakiness, add two tests to presubmit"