tags:

views:

175

answers:

2

Using the JUnit ant task to run my Unit Tests from CruiseControl on Centos 5.4

My jUnit Task forks to run the tests, the majority of which work ok, however I keep getting intermittent failures where the JVM crashes, always with the same error:

[junit] Fatal: Stack size too small. Use 'ulimit -s' to increase default stack size.

I've doubled the stack size using ulimit and the crashes continue to happen. The JUnit task runs about 100 different jUnit test classes and the JVM crash can happen in any of them, so I don't believe that the behaviour is due to any particular test.

ulimit -a tells me that the stack size is 32768 kb ( I've upped it a few times to get it to this point ), which seems huge to me.

Running the sun jdk 1.3

Anyone got any clues, or recommendations about what a sensible stack size might be.

There has never been any mention of increasing the java stack size ( -Xss ) - but I tried it anyway with the same result.

Dave

+3  A: 

Did you add something like this:

<jvmarg line="-Xss512k"/>

in the ant script or just increase the stack for the ant process itself (assuming, of course, that you are forkign the tests instead of running them inside the ant instance of the VM).

TofuBeer
"There has never been any mention of increasing the java stack size ( -Xss ) - but I tried it anyway with the same result."
Woot4Moo
Doesn't mean it was the spawned vm that the stack was increased. Increasing the stack ant runs in does not increase the stack for the vm that the tests run in
TofuBeer
I didn't increase the stack size for the ant process itself, I just increased the stack size for the junit task within it. This forks a new process for each test ( specified within a BATCHTEST tag ), which I am assuming gets the stack size that I specified on the junit task.
Yeah if you have a tag like in my answer inside the tag for the batch test that should do it.What if you run the tests by hand instea of through ant? On the command lone not in an IDE.
TofuBeer
A: 

My thoughts on this matter are that somehow things aren't being popped off the internal stack, which I realize is obvious. Since you say it fails arbitrarily throughout the testing process it is a bit difficult to track down. How many of these test cases are recursive in nature? Also how many forks are being executed?

Woot4Moo
I don't think that any test cases are ( intentionally ) recursive, and essentially the same cruise control set up runs perfectly on windows, and under JDK 1.5 and Centos ( all be it on a different physical machine ). One thing that I have noticed ( and may have some bearing ) is that when I run the test cases in Eclipse under JDK1.3 on Ubuntu, they never seem to finish correctly. If I run a test plan in the IDE the tests all run, but the JVM never completes and I have to manually terminate it. I guess the two things are related ( byt the penny didn't drop til I read your comment )
That could be an issue :)
Woot4Moo