HDFS-13559. TestBlockScanner does not close TestContext properly. Contributed by Anbang Hu.

(cherry picked from commit 454de3b543)
This commit is contained in:
Inigo Goiri 2018-05-16 19:23:02 -07:00
parent 16e89a2771
commit fcf0b6a8dd
1 changed files with 4 additions and 1 deletions

View File

@ -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,