[Webtest] Memory issue (problem in htmlunit)
webtest@lists.canoo.com
webtest@lists.canoo.com
Thu, 13 Oct 2005 19:03:05 -0500 (CDT)
We've been using canoo webtest for a while now. Overall
we're very happy with it and find it very useful. The issue we had stems
from memory usage, it seems others have also had this.
We're using canoo webtest to do some testing of our java web app, and have
quite a few tests split up into many test files.
Each test has around 20-30 steps on average.
We're calling them from an ant build file like so:
<ant antfile="test1.xml"/>
<ant antfile="test2.xml"/>
<ant antfile="test3.xml"/>
etc.
However, as we got more and more tests, we started getting memory errors
as the ant task never let the memory go.
Using a profiler on the ant task, I found that htmlunit was starting a
setimeout thread that was never being stopped, so ant would hang onto the
memory until all of the tests had finished. After making this thread stop
straight away, all of the memory issues disappeared, and speed was
improved.
The thread is in Window.java if anyone is curious. I'll talk to the
htmlunit guys and hopefully get a patch in to fix this.
Ash