connection.wait, time and iteration limit, and tests