fix timeout race condition in test