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 8013feb1ba2..6281e71ef50 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 @@ -300,7 +300,7 @@ public class TestFixedLengthInputFormat { 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