Maven Surefire
  1. Maven Surefire
  2. SUREFIRE-798

JUnit47 provider could print immediatly the test class name, as JUnit4, instead of waiting for the test to finish.

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Not A Problem
    • Affects Version/s: 2.10
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      all

      Description

      With a test that takes some time, for example

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

      With JUnit4, we have first

      Running Test0

      Then, 6 seconds later

      Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6.002 sec

      With JUnit47, we wait for 6 seconds, then the two lines appear simultaneously.

      The former behavior is better, because it allows to kill the test if we know that this test should not take so long. It also gives the feeling that you know what's going on .

        Activity

        Nicolas Liochon created issue -
        Hide
        Kristian Rosenvold added a comment -

        I assume you're thinking about /when running in serial/ ? For all kinds of parallel, the current behaviour will not change, since it keeps output linear.

        Show
        Kristian Rosenvold added a comment - I assume you're thinking about /when running in serial/ ? For all kinds of parallel, the current behaviour will not change, since it keeps output linear.
        Hide
        Nicolas Liochon added a comment -

        Yes, it's when running in serial. I understand that in parallel you want to keep them together, it makes sense...

        Show
        Nicolas Liochon added a comment - Yes, it's when running in serial. I understand that in parallel you want to keep them together, it makes sense...
        Hide
        Nicolas Liochon added a comment -

        As a side effect as well, note that when a forked process timeouts with JUnit47, there is no entry in the console at all. The final status says 'failure or timeout', but there is no direct way to find out which one of the test timeouted.

        Show
        Nicolas Liochon added a comment - As a side effect as well, note that when a forked process timeouts with JUnit47, there is no entry in the console at all. The final status says 'failure or timeout', but there is no direct way to find out which one of the test timeouted.
        Hide
        Tibor Digana added a comment -

        Nicolas, Can we close this as designed?
        Another alternative with forked process sounds like another bug.

        BTW, Since of surefire 2.17 you can define the timeout in Junit 4.7+ parallel. It allows you to see previous logs and gives you chance to see what tests have started/executed till the timeout.

        Show
        Tibor Digana added a comment - Nicolas, Can we close this as designed? Another alternative with forked process sounds like another bug. BTW, Since of surefire 2.17 you can define the timeout in Junit 4.7+ parallel. It allows you to see previous logs and gives you chance to see what tests have started/executed till the timeout.
        Hide
        Nicolas Liochon added a comment -

        Yeah, it's fine for me. The 2.17 way of presenting test results is great.

        Show
        Nicolas Liochon added a comment - Yeah, it's fine for me. The 2.17 way of presenting test results is great.
        Hide
        Tibor Digana added a comment -

        as designed

        Show
        Tibor Digana added a comment - as designed
        Tibor Digana made changes -
        Field Original Value New Value
        Resolution Not A Bug [ 6 ]
        Status Open [ 1 ] Closed [ 6 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:23:32 UTC 2015 [ 1428240212200 ]
        Mark Thomas made changes -
        Workflow jira [ 12728044 ] Default workflow, editable Closed status [ 12759414 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 01:36:33 UTC 2015 [ 1428284193036 ]
        Mark Thomas made changes -
        Workflow jira [ 12966151 ] Default workflow, editable Closed status [ 13003848 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        1033d 20h 31m 1 Tibor Digana 25/Sep/14 05:29

          People

          • Assignee:
            Unassigned
            Reporter:
            Nicolas Liochon
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development