Details
-
Type:
Bug
-
Status: Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Test
-
Labels:None
Description
I'm seeing the following on my system, at which point junit stops:
[junit] Running com.cloudera.flume.agent.diskfailover.TestConcurrentDFOMan
[junit] Tests run: 11, Failures: 5, Errors: 0, Time elapsed: 161.737 sec
[junit] Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
[junit] at java.util.Arrays.copyOf(Arrays.java:2786)
[junit] at java.lang.StringCoding.safeTrim(StringCoding.java:64)
[junit] at java.lang.StringCoding.access$300(StringCoding.java:34)
[junit] at java.lang.StringCoding$StringEncoder.encode(StringCoding.java:251)
[junit] at java.lang.StringCoding.encode(StringCoding.java:272)
[junit] at java.lang.StringCoding.encode(StringCoding.java:284)
[junit] at java.lang.String.getBytes(String.java:986)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter.endTestSuite(PlainJUnitResultFormatter.java:152)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.fireEndTestSuite(JUnitTestRunner.java:619)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:452)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:911)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:768)
Notice that it's junit that's running out of memory - it's unable to handle the huge amount of dfo test logs that are being output at debug level due to this in the test:
@Before
public void setDebug()
The test should not set the debugging level, rather this should be set in the log4j.properties file. Such code should be removed from all tests.