fix test implementation, would lead to deadlock