You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "nkeywal (JIRA)" <ji...@codehaus.org> on 2011/12/05 08:50:39 UTC
[jira] Reopened: (SUREFIRE-793) JUnit47 provider reports incorrect
time in the XML report
[ https://jira.codehaus.org/browse/SUREFIRE-793?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
nkeywal reopened SUREFIRE-793:
------------------------------
I still have a wrong reported time in the xml file on 2.12-snapshot:
With JUnit47:
{noformat}
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite failures="0" time="0.007" errors="0" skipped="0" tests="2" name="Test0">
<testcase time="6.004" classname="Test0" name="testT0"/>
<testcase time="6" classname="Test0" name="testT1"/>
</testsuite>
{noformat}
With JUnit4:
{noformat}
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite failures="0" time="16.062" errors="0" skipped="0" tests="2" name="Test0">
[skip properties]
<testcase time="6.004" classname="Test0" name="testT0"/>
<testcase time="5.997" classname="Test0" name="testT1"/>
</testsuite>
{noformat}
> JUnit47 provider reports incorrect time in the XML report
> ---------------------------------------------------------
>
> Key: SUREFIRE-793
> URL: https://jira.codehaus.org/browse/SUREFIRE-793
> Project: Maven Surefire
> Issue Type: Bug
> Components: Junit 4.7+ (parallel) support
> Affects Versions: 2.10, 2.11
> Environment: all
> Reporter: nkeywal
> Assignee: Kristian Rosenvold
> Priority: Critical
> Fix For: 2.11
>
> Attachments: surefire_793_trunk.v3.patch
>
>
> With this test:
> {noformat}
> public class Test0 {
> @Test
> public void testT0() throws Exception {
> Thread.sleep(2000);
> }
> }
> {noformat}
> The time presented in the XML report is wrong (close to zero), both for the total time and the time spent in the method. It's a side effect of the replay mechanism. I can't make it working without hacking the code quite a lot and probably breaking the other use cases, so a clean fix would be really appreciated. The complete test case would include before & after stuff, like this:
> {noformat}
> public class Test0 {
> @Test
> public void testT0() throws Exception {
> Thread.sleep(2000);
> }
> @Test
> public void testT1() throws Exception {
> Thread.sleep(2000);
> }
> @BeforeClass
> public static void setUpBeforeClass() throws Exception {
> Thread.sleep(2000);
> }
> @AfterClass
> public static void tearDownAfterClass() throws Exception {
> Thread.sleep(2000);
> }
> @Before
> public void setUp() throws Exception {
> Thread.sleep(2000);
> }
> @After
> public void tearDown() throws Exception {
> Thread.sleep(2000);
> }
> }
> {noformat}
> The data are correct (at least individual method time) when using JUnit4 provider.
> It's important, because the XML reports are used by Jenkins, and the test time is something we monitor very carefully.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira