Details
-
Bug
-
Resolution: Done
-
Major
-
7.0.0.Alpha5
-
None
Description
When looking into serialization issues I found that many map reduce failures occur due to not serializable exceptions. Looking closer it appears this was caused by the testCombinerForDistributedReductionWithException method because the anonymous inner class cannot be serialized and throws a CacheException causing the test to pass. However if I pass in a serializable class the test fails because the Divide By Zero exception is swallowed incorrectly.
@Test(expectedExceptions = CacheException.class) public void testCombinerForDistributedReductionWithException() throws Exception { MapReduceTask<String, String, String, Integer> task = invokeMapReduce(null); task.combinedWith(new DivideByZeroReducer()); task.execute(); } private static class DivideByZeroReducer implements Reducer<String, Integer>, Serializable { @Override public Integer reduce(String reducedKey, Iterator<Integer> iter) { //simulating exception int a = 4 / 0; return null; } }