Fix to wait feature in tests