* Test restart of the previous Auditor bookie shouldn't initiate
* re-election and should create new vote after restarting.
*/
@Test(timeout=60000)
public void testRestartAuditorBookieAfterCrashing() throws Exception {
BookieServer auditor = verifyAuditor();
shutdownBookie(auditor);
String addr = StringUtils.addrToString(auditor.getLocalAddress());
// restarting Bookie with same configurations.
int indexOfDownBookie = bs.indexOf(auditor);
ServerConfiguration serverConfiguration = bsConfs
.get(indexOfDownBookie);
bs.remove(indexOfDownBookie);
bsConfs.remove(indexOfDownBookie);
tmpDirs.remove(indexOfDownBookie);
auditorElectors.remove(addr);
startBookie(serverConfiguration);
// starting corresponding auditor elector
LOG.debug("Performing Auditor Election:" + addr);
startAuditorElector(addr);
// waiting for new auditor to come
BookieServer newAuditor = waitForNewAuditor(auditor);
Assert.assertNotSame(
"Auditor re-election is not happened for auditor failure!",
auditor, newAuditor);
Assert.assertFalse("No relection after old auditor rejoins", auditor
.getLocalAddress().getPort() == newAuditor.getLocalAddress()
.getPort());
}