Test cases for handling different critical section issues