@Test(expected=IOException.class)
public void connectionRetryTimeoutTest() throws Exception {

    Learner learner = new TimeoutLearner();
    learner.self = new QuorumPeer();
    learner.self.setTickTime(2000);
    learner.self.setInitLimit(5);
    learner.self.setSyncLimit(2);
    // this addr won't even be used since we fake the Socket.connect
    InetSocketAddress addr = new InetSocketAddress(1111);
    // we expect this to throw an IOException since we're faking socket connect errors every time
    learner.connectToLeader(addr, "");
}