Fix for test deadlocking