Add test case for race condition.