Add a test case for race condition