Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-793

JUnit47 provider reports incorrect time in the XML report

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.10, 2.11
    • 2.11, 2.12
    • None
    • all

    Description

      With this test:

      public class Test0 {
      
        @Test
        public void testT0() throws Exception {
          Thread.sleep(2000);
        }
      }
      

      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:

      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);
        }
      }
      

      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.

      Attachments

        1. surefire_793_trunk.v3.patch
          4 kB
          Nicolas Liochon

        Issue Links

          Activity

            People

              krosenvold Kristian Rosenvold
              nkeywal Nicolas Liochon
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: