This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 224442 - Not all test results displayed when running Surefire in parallel
Summary: Not all test results displayed when running Surefire in parallel
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 7.3
Hardware: PC Linux
: P1 normal with 1 vote (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-03 22:04 UTC by Jesse Glick
Modified: 2014-08-25 18:02 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2013-01-03 22:04:39 UTC
20130102-2aaac3cd1678, JDK 7u9, Linux. Have open Jenkins sources from a branch using parallel Surefire [1]. Ran tests on a package:

cd …/test; JAVA_HOME=… …/java/maven/bin/mvn -Dtest=hudson.console.*Test test-compile surefire:test

The Maven output looks fine:

 T E S T S
-------------------------------------------------------
Running hudson.console.ExceptionAnnotationTest
Running hudson.console.ConsoleAnnotatorTest
Running hudson.console.UrlAnnotatorTest
…
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 28.386 sec
…
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 30.048 sec
…
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 48.364 sec
Results :
Tests run: 10, Failures: 0, Errors: 0, Skipped: 0
------------------------------------------------------------------------
BUILD SUCCESS

but the Test Results window shows only the two test cases from UrlAnnotatorTest.

[1] https://github.com/jglick/jenkins/commit/5c0d9cd60f341b9fb853be14e758fafab3f18523
Comment 1 Theofanis Oikonomou 2013-11-21 11:21:52 UTC
Changeset: 8a5f44e27c89
Author:    Theofanis Oikonomou <theofanis@netbeans.org>
Date:      2013-11-21 12:22
Message:
Comment 2 Theofanis Oikonomou 2013-11-21 15:37:14 UTC
Changeset: 5abb65271023
Author:    Theofanis Oikonomou <theofanis@netbeans.org>
Date:      2013-11-21 16:38
Message:   - additional fix to use maven api
Comment 3 Quality Engineering 2013-11-23 04:26:11 UTC
Integrated into 'main-silver', will be available in build *201311230002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/5abb65271023
User: Theofanis Oikonomou <theofanis@netbeans.org>
Log: - additional fix to use maven api
Task #224442 - Not all test results displayed when running Surefire in parallel
Comment 4 Jesse Glick 2014-03-19 15:56:03 UTC
Well now in 20140317-eacabc97e7bc all the results *are* displayed, but only after the entire Maven test run has completed—there is no incremental display.
Comment 5 Theofanis Oikonomou 2014-06-20 15:10:50 UTC
(In reply to Jesse Glick from comment #4)
> Well now in 20140317-eacabc97e7bc all the results *are* displayed, but only
> after the entire Maven test run has completed—there is no incremental
> display.

Correct me if I am wrong, but I think this is due to the fact that surefire is dumbing output after all tests are finished, when run in parallel mode. So until all tests are done the output-listener is not notified and thus not updating the UI. Not much can be done in this case in nb side.
Comment 6 Jesse Glick 2014-06-26 21:03:34 UTC
(In reply to Theofanis Oikonomou from comment #5)
> I think this is due to the fact that surefire
> is dum[p]ing output after all tests are finished, when run in parallel mode.

Not true. Using maven-surefire-plugin:2.17:test, Maven shows output as suites finish:

Running Test1
Running Test2
Running Test3
Running Test4
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 42.482 sec - in Test2
Running Test5
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 50.512 sec - in Test3
Running Test6
Tests run: 63, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 54.782 sec - in Test1
Running Test7
…

and target/surefire-reports/TEST-*.xml (as well as *.txt and *-output.txt) appear as soon as each suite is finished as well. Yet NetBeans (20140619-c7b326d0638f) just shows “Running…” until the very end, 5½ minutes later.
Comment 7 Theofanis Oikonomou 2014-06-27 18:16:09 UTC
Changeset: b279011db3c0
Author:    Theofanis Oikonomou <theofanis@netbeans.org>
Date:      2014-06-27 20:15
Message:
Comment 8 Theofanis Oikonomou 2014-06-27 18:20:18 UTC
It should be fixed now. I had some issues when using reuseForks=true and a forkCount value larger than one. The same output was shown in the output window. I think I handled this case effectively as to not show multiple nodes for the same test class. NOt sure if I missed something critical though. Any insight would be much appreciated. Thanks
Comment 9 Quality Engineering 2014-07-01 02:40:55 UTC
Integrated into 'main-silver', will be available in build *201407010002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/b279011db3c0
User: Theofanis Oikonomou <theofanis@netbeans.org>
Log: Task #224442 - Not all test results displayed when running Surefire in parallel
Comment 10 Jesse Glick 2014-08-20 22:48:28 UTC
20140818-f47eef37f759 test results are not displayed at all even when running a single test case, never mind parallel tests. The Test Results window opens but just says

> No tests executed.(0.0 s)

CoS, github.com/jenkinsci/jenkins/test/src/test/java/**/*Test.java.
Comment 11 Theofanis Oikonomou 2014-08-21 16:06:08 UTC
Changeset: 36170197fc52
Author:    Theofanis Oikonomou <theofanis@netbeans.org>
Date:      2014-08-21 18:05
Message:
Comment 12 Theofanis Oikonomou 2014-08-21 16:09:16 UTC
reproducible in latest build. Should be fixed now. 

Jirko can this make it in 8.0.1? Thanks
Comment 13 Jiri Kovalsky 2014-08-22 05:43:44 UTC
No, it's too late for 8.0.1. I am sorry. The fix will be available in NetBeans 8.1.
Comment 14 Jiri Kovalsky 2014-08-22 13:54:42 UTC
As a serious regression against NetBeans 8.0 this must be fixed in 8.0.1 timeframe. Increasing priority to reflect showstopper status.
Comment 15 Antonin Nebuzelsky 2014-08-22 15:53:05 UTC
Backported to release801:
http://hg.netbeans.org/releases/rev/bf8eac8b4a82
Comment 16 Jiri Kovalsky 2014-08-22 16:54:28 UTC
Bug reproduced in:

Product Version: NetBeans IDE 8.0.1 (Build 201408212300)
Java: 1.7.0_67; Java HotSpot(TM) 64-Bit Server VM 24.65-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_67-b01
System: Linux version 3.13.0-24-generic running on amd64; UTF-8; en_US (nb)
Comment 17 Jiri Kovalsky 2014-08-22 17:09:49 UTC
Returning correct TM. Sorry for spamming.
Comment 18 Jesse Glick 2014-08-22 20:38:49 UTC
Glad I reported that! Will recheck once this gets into main-silver.
Comment 19 Quality Engineering 2014-08-23 04:53:52 UTC
Integrated into 'main-silver', will be available in build *201408230001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/36170197fc52
User: Theofanis Oikonomou <theofanis@netbeans.org>
Log: Task #224442 - Not all test results displayed when running Surefire in parallel
Comment 20 Quality Engineering 2014-08-23 06:08:21 UTC
Integrated into 'releases/release801', will be available in build *201408222300* or newer. Wait for official and publicly available build.

Changeset: http://hg.netbeans.org/releases/rev/bf8eac8b4a82
User: Theofanis Oikonomou <theofanis@netbeans.org>
Log: Task #224442 - Not all test results displayed when running Surefire in parallel
Comment 21 Jiri Kovalsky 2014-08-23 22:16:18 UTC
Product Version: NetBeans IDE 8.0.1 (Build 201408222300)
Java: 1.8.0_20; Java HotSpot(TM) 64-Bit Server VM 25.20-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_20-b31
System: Linux version 3.13.0-24-generic running on amd64; UTF-8; en_US (nb)

Works like a charm. Test results window now displays errors correctly and updates itself incrementally if tests are run in parallel. Verified.
Comment 22 Jesse Glick 2014-08-25 18:02:05 UTC
Finally working smoothly in 20140825-9a94e8cb336b, thanks!