3

I have suite of Junit tests which passes every time I run locally. I have setup a job to run the suite, hudson uses ANT to invoke the tests.This suite was passing in the hudson machine for quite some time. But from last 3 days one test fails some times (randomly). And We have not changed to code. The error is :

Error Message

Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit.

Stacktrace

junit.framework.AssertionFailedError: Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit.

I couldn't find proper answer on google. I checked here

but it doesn't seem to help.

Hudson machine details : Windows 2003 Server Java 1.6.0.29

Community
  • 1
  • 1
java_enthu
  • 2,279
  • 7
  • 44
  • 74
  • possible duplicate of ["Forked Java VM exited abnormally" error from junit tests](http://stackoverflow.com/questions/1846329/forked-java-vm-exited-abnormally-error-from-junit-tests), but you may want to look here: http://softwaresalariman.blogspot.com/2008/09/netbeans-junit-java-vm-exited.html – dmeister Jan 10 '12 at 07:32
  • On the blog author has mentioned not to fork the new JVM but its not possible in my case. It may look duplicate but that question also is have the solution :) – java_enthu Jan 10 '12 at 10:18
  • 2
    Check ram usage when hudson building project.My be it hitting a java bug. – ayengin Jan 11 '12 at 20:37
  • 2
    Use the 64bit version if possible. Increase heap size (MX) and PermGen size of the forked java vm. – vasquez Jan 13 '12 at 14:14
  • You might want to describe the offending test itself a bit more? Any concurrency issues? Improper context propagation from other tests (e.g. shared state via a database or static class members)? Native method calls? – Ustaman Sangat Jan 28 '12 at 21:19

1 Answers1

0

Do you still have access to the console log for the failed Hudson build? If the JVM is exiting 'unexpectedly' you may find a JVM bug is causing it to crash, which would not appear in the JUnit logs (which I assume is where you've got the error message/stack trace from), but probably would do in the output from Ant.

Alternatively:

  • Which version of Ant are you running? I have heard of a bug pre-Ant 1.7.1 that caused System.exit() to be called under some circumstances.
  • You may want to check that your code is not catching any exceptions that it shouldn't be (e.g. catch Throwable).
Jonny
  • 842
  • 5
  • 14