MAPREDUCE-7052. TestFixedLengthInputFormat#testFormatCompressedIn is flaky. Contributed by Peter Bacsko

(cherry picked from commit a53d62ab26e170a0338f93e228718da52e9196e4)
This commit is contained in:
Jason Lowe 2018-02-15 15:12:57 -06:00
parent 961876e94f
commit 1871e6844e

View File

@ -300,7 +300,7 @@ private void runRandomTests(CompressionCodec codec) throws IOException {
if (i > 0) {
if (i == (MAX_TESTS-1)) {
// Test a split size that is less than record len
numSplits = (int)(fileSize/Math.floor(recordLength/2));
numSplits = (int)(fileSize/ Math.max(1, Math.floor(recordLength/2)));
} else {
if (MAX_TESTS % i == 0) {
// Let us create a split size that is forced to be