i'm trying run junit 3 , junit 4 tests ant 1.9.4 fork="true" in junit task experience strange errors (jvm) crash:
12:40:58,686 [master>build>run , publish unit tests , coverage>run tests@lnzvt-fls0010:80] info - [junit] testcase: testadd took 0,005 sec 12:40:58,686 [master>build>run , publish unit tests , coverage>run tests@lnzvt-fls0010:80] info - [junit] testcase: testadd1 took 0 sec 12:40:58,755 [master>build>run , publish unit tests , coverage>run tests@lnzvt-fls0010:80] info - [junit] testsuite: vai.testproduct.testcalculator3 12:40:58,755 [master>build>run , publish unit tests , coverage>run tests@lnzvt-fls0010:80] info - [junit] tests run: 1, failures: 0, errors: 1, skipped: 0, time elapsed: 0 sec 12:40:58,755 [master>build>run , publish unit tests , coverage>run tests@lnzvt-fls0010:80] info - 12:40:58,756 [master>build>run , publish unit tests , coverage>run tests@lnzvt-fls0010:80] info - [junit] testcase: null took 0 sec 12:40:58,756 [master>build>run , publish unit tests , coverage>run tests@lnzvt-fls0010:80] info - [junit] caused error 12:40:58,756 [master>build>run , publish unit tests , coverage>run tests@lnzvt-fls0010:80] info - [junit] forked java vm exited abnormally. please note time in report not reflect time until vm exit. 12:40:58,756 [master>build>run , publish unit tests , coverage>run tests@lnzvt-fls0010:80] info - [junit] junit.framework.assertionfailederror: forked java vm exited abnormally. please note time in report not reflect time until vm exit.
when run unit tests fork="false" there no problem. ant task looks follows
<junit failureproperty="testcasesfailed" jvm="c:\program files\java\jdk1.8.0_40\bin\java" fork="true" clonevm="true" showoutput="false" haltonfailure="false" haltonerror="false" timeout="600000" printsummary="true" includeantruntime="true"> <!-- note timeout of 10 minutes--> <jvmarg line="-djava.awt.headless=true" /> <jvmarg value="-dbuilddate=${builddate}" /> <jvmarg value="-xx:errorfile=./myfile%.txt" /> <jvmarg value="-xx:+printcommandlineflags" /> <!--<jvmarg value="-xx:+unlockcommercialfeatures"/> <jvmarg value="-xx:+flightrecorder" /> <jvmarg value="-xx:flightrecorderoptions=dumponexit=true,defaultrecording=true,dumponexitpath=.,loglevel=info" />--> <classpath refid="test.classpath" /> <formatter type="xml" /> <formatter type="plain" usefile="false" /> <batchtest todir="${tests.report.dir}"> <fileset dir="${target.tests.dir}" includes="${tests.includes}" excludes="${tests.excludes}" /> </batchtest> </junit>
it doesn't work without jvm attribute either. test.classpath seems correctly filled junit 4, too.
the problem independent of code in unit tests: if tests contains assertequals(true, true) jvm crashes. jvm doesn't write crash file. when run jvm flightrecorder there deadlock , never terminates until junit ant task timeout reached.
remote debugging didn't work either, jvm running test terminate debugger connects.
basically played of parameters available in junit ant task , none of them worked (showoutput="true"/"false" clonevm="true"/"false" etc..)
in similar questions on stackoverflow suggested system.exit() or outofmemoryexception cause problem, not case here.
running junit 4 tests ant should work without problems out of box - idea problem here?
problem there old ant contribution older version of ant in (very long) classpath mysteriously made jvms crash.
Comments
Post a Comment