ENG-5769 Fix concurrency (again) and fix unit test.