From a53d62ab26e170a0338f93e228718da52e9196e4 Mon Sep 17 00:00:00 2001 From: Jason Lowe Date: Thu, 15 Feb 2018 15:12:57 -0600 Subject: [PATCH] MAPREDUCE-7052. TestFixedLengthInputFormat#testFormatCompressedIn is flaky. Contributed by Peter Bacsko --- .../org/apache/hadoop/mapred/TestFixedLengthInputFormat.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestFixedLengthInputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestFixedLengthInputFormat.java index 4864dd04a1..51347296a8 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestFixedLengthInputFormat.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestFixedLengthInputFormat.java @@ -301,7 +301,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