HDFS-13895. EC: Fix Intermittent Failure in TestDFSStripedOutputStreamWithFailureWithRandomECPolicy. Contributed by Ayush Saxena.

This commit is contained in:
Vinayakumar B 2018-09-10 09:22:59 +05:30
parent 30eceec342
commit eef3bafae8

View File

@ -244,15 +244,19 @@ public void testCloseWithExceptionsInStreamer() throws Exception {
// Full stripe and a partial on non-cell boundary
(cellSize * dataBlocks) + 123,
};
try {
for (int length: fileLengths) {
// select the two DNs with partial block to kill
final int[] dnIndex = {dataBlocks - 2, dataBlocks - 1};
int[] dnIndex = null;
if (parityBlocks > 1) {
dnIndex = new int[] {dataBlocks - 2, dataBlocks - 1};
} else {
dnIndex = new int[] {dataBlocks - 1};
}
for (int length : fileLengths) {
final int[] killPos = getKillPositions(length, dnIndex.length);
try {
LOG.info("runTestWithMultipleFailure2: length==" + length
+ ", killPos=" + Arrays.toString(killPos)
+ ", dnIndex=" + Arrays.toString(dnIndex));
LOG.info("runTestWithMultipleFailure2: length==" + length + ", killPos="
+ Arrays.toString(killPos) + ", dnIndex="
+ Arrays.toString(dnIndex));
setup(conf);
runTest(length, killPos, dnIndex, false);
} catch (Throwable e) {
@ -260,12 +264,11 @@ public void testCloseWithExceptionsInStreamer() throws Exception {
+ ", dnIndex=" + Arrays.toString(dnIndex) + ", length=" + length;
LOG.error(err);
throw e;
}
}
} finally {
tearDown();
}
}
}
/**
* Test writing very short EC files with many failures.