Fix fuzzy deadlocking in test framework.