HDFS-13559. TestBlockScanner does not close TestContext properly. Contributed by Anbang Hu.
This commit is contained in:
parent
be53969047
commit
454de3b543
|
@ -125,6 +125,7 @@ public class TestBlockScanner {
|
|||
if (cluster != null) {
|
||||
for (int i = 0; i < numNameServices; i++) {
|
||||
dfs[i].delete(new Path("/test"), true);
|
||||
dfs[i].close();
|
||||
}
|
||||
cluster.shutdown();
|
||||
}
|
||||
|
@ -817,6 +818,7 @@ public class TestBlockScanner {
|
|||
"in recentSuspectBlocks.", info.goodBlocks.contains(first));
|
||||
info.blocksScanned = 0;
|
||||
}
|
||||
ctx.close();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -873,6 +875,7 @@ public class TestBlockScanner {
|
|||
info.blocksScanned = 0;
|
||||
}
|
||||
info.sem.release(1);
|
||||
ctx.close();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -933,12 +936,12 @@ public class TestBlockScanner {
|
|||
os.write(bytes);
|
||||
os.hflush();
|
||||
os.close();
|
||||
fs.close();
|
||||
|
||||
// verify that volume scanner does not find bad blocks after append.
|
||||
waitForRescan(info, numExpectedBlocks);
|
||||
|
||||
GenericTestUtils.setLogLevel(DataNode.LOG, Level.INFO);
|
||||
ctx.close();
|
||||
}
|
||||
|
||||
private void waitForRescan(final TestScanResultHandler.Info info,
|
||||
|
|
Loading…
Reference in New Issue