mirror of https://github.com/apache/lucene.git
tests: cancel Timer
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1579125 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
daa10a5435
commit
ee0eeb2d77
|
@ -100,6 +100,9 @@ public class StressHdfsTest extends BasicDistributedZkTest {
|
|||
}
|
||||
|
||||
if (testRestartIntoSafeMode) {
|
||||
Timer timer = new Timer();
|
||||
|
||||
try {
|
||||
createCollection(DELETE_DATA_DIR_COLLECTION, 1, 1, 1);
|
||||
|
||||
waitForRecoveriesToFinish(DELETE_DATA_DIR_COLLECTION, false);
|
||||
|
@ -110,7 +113,7 @@ public class StressHdfsTest extends BasicDistributedZkTest {
|
|||
NameNodeAdapter.enterSafeMode(dfsCluster.getNameNode(), false);
|
||||
|
||||
int rnd = LuceneTestCase.random().nextInt(10000);
|
||||
Timer timer = new Timer();
|
||||
|
||||
timer.schedule(new TimerTask() {
|
||||
|
||||
@Override
|
||||
|
@ -122,6 +125,9 @@ public class StressHdfsTest extends BasicDistributedZkTest {
|
|||
ChaosMonkey.start(jettys.get(0));
|
||||
|
||||
waitForRecoveriesToFinish(DELETE_DATA_DIR_COLLECTION, false);
|
||||
} finally {
|
||||
timer.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue