When a <junit> timeout occurs, the formatter log files do not contain the logs of the test, though if you use "showoutput=true" the logs are visible on the console. If I have a formatter set up for the <junit> task and a timeout occurs during a test execution, then the log output of the test does not appear in the formatter text file. However, if I specify "showoutput=true" in the <junit> task, then the output of the test appears in the console. <junit printsummary="true" fork="true" dir="${ecm.basedir}" haltonfailure="true" failureproperty="test.failed" timeout="600000" maxmemory="1024m" showoutput="${junit.showoutput}"> <formatter type="brief" /> <formatter type="xml" /> If a timeout occurs after 10 minutes, the *.TXT and *.XML files of the formatter do not contain any log output. They only have a couple of lines indicating that a timeout occurred. However, if I set showoutput to true, then the console contains all of the logging data of the test prior to the timeout, which makes it much easier to figure out why the test timed out. In our case, we use the MailLogger to send out the log, so we can't have all the output going to the console, since it grows too large to be sent via e-mail. The doc for the showoutput attribute indicates that it should be the same data that goes to the formatters: Showoutput - Send any output generated by tests to Ant's logging system as well as to the formatters. By default only the formatters receive the output.
hi, This issue is still present in ant 1.7.0. If the timeout is reached, or if the VM exits by its own, logs are displayed on the console but are not printed by the XML formatter. How an user is supposed to understand why a test had crashed if logs are lost ? :-)
This is a known issue of the fact that the XML format includes summary attributes on the root element; the test result formatter builds up a DOM in memory and saves it on success. when the JVM is killed, no file, so no diagnostics. a brand new XML format would fix this, but there's no easy way to do an stream-to-disk version of the current format. What we could do is add an option to save the (incomplete) DOM to disk after every test. This is something you could turn on with a java property in the test process. It would make big test runs slower, but let people diagnose what the last test that finished was, and from that, infer what went wrong.
I'm finding that, when using <junit> with a timeout and <batchtest>, if the timeout occurs there is no output written to the XML results file at all. The test does not then appear in the subsequent junitreport. As a result of this nobody noticed that a dozen or so of our tests were never being executed due to a timeout. A fix or workaround for this whould be highly appreciated.
I think this has been fixed as a side effect of fixing bug 39946. In either case, svn revision 728058 contains testcases for this and they path with trunk as well as Ant 1.7.1.