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 227541 - Parallel JUnit test runs not correctly displayed
Summary: Parallel JUnit test runs not correctly displayed
Status: RESOLVED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.4
Hardware: PC Linux
: P3 normal (vote)
Assignee: Tomas Stupka
URL: https://jira.codehaus.org/browse/SURE...
Keywords:
Depends on: 194090
Blocks:
  Show dependency tree
 
Reported: 2013-03-15 20:44 UTC by Jesse Glick
Modified: 2016-07-07 08:38 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
proposed patch (8.81 KB, patch)
2013-08-28 08:45 UTC, Milos Kleint
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2013-03-15 20:44:57 UTC
Dev build. If you pass <forkCount>2</> in Surefire config (2.14+) and run two tests (e.g. multiselect in Projects: -Dtest=p.FirstTest,p.SecondTest), the Test Results window will display results from only one of them.
Comment 1 Milos Kleint 2013-03-20 13:29:06 UTC
is this related to issue https://jira.codehaus.org/browse/SUREFIRE-968?
Comment 2 Jesse Glick 2013-03-20 13:45:00 UTC
Possibly. Not sure how the mapping from Maven console output to the JUnit listener works internally. Seems pretty fragile; perhaps it would be better to watch target/surefire-reports/TEST-*.xml for new or modified files (with a timestamp later than the build start and a closing </testsuite> tag)? For Ant <junit> we listen for verbose messages that announce significant events, but there is no equivalent for forked Maven builds, unless NetBeans adds a build agent (#194090).

By the way another issue not related to parallelism is that no progress is shown for test cases within a suite, which is relevant when one suite with a dozen tests takes a couple minutes to run. Unfortunately I know of no way to fix this given Surefire’s current behavior. target/surefire-reports/*-output.txt is updated “live” which is helpful in case your tests print lots to stdio, though there is no standard header announcing that a new test case is starting or has completed.
Comment 3 Jesse Glick 2013-06-10 16:26:41 UTC
As of https://github.com/jenkinsci/jenkins/commit/3238d6328db4f7a5377cf088e5b0e9a3ba5ca740 I get output like this:

Running jenkins.scm.SCMCheckoutStrategyTest
Running jenkins.ExtensionFilterTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 18.712 sec - in jenkins.ExtensionFilterTest
Running jenkins.model.JenkinsTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 76.628 sec - in jenkins.scm.SCMCheckoutStrategyTest
Running jenkins.model.ExtensionTypeHierarchyTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.317 sec - in jenkins.model.ExtensionTypeHierarchyTest
Running jenkins.model.JenkinsLocationConfigurationTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 9.474 sec - in jenkins.model.JenkinsLocationConfigurationTest
Running jenkins.model.PeepholePermalinkTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6.596 sec - in jenkins.model.PeepholePermalinkTest
Running jenkins.model.BuildDiscarderTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.72 sec - in jenkins.model.BuildDiscarderTest
Running jenkins.security.RekeySecretAdminMonitorTest
Tests run: 15, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 83.658 sec - in jenkins.model.JenkinsTest
Running jenkins.security.ApiTokenPropertyTest
…

(concurrency 2×) which is fine. But the Test Results window only shows half of the test suites.

Not sure whether this should be considered P2. There is a workaround, but it is to set concurrency to 1× and so make tests run more slowly.
Comment 4 Milos Kleint 2013-08-28 08:45:56 UTC
Created attachment 139348 [details]
proposed patch

attached is a proposed patch. There's one problem with it however. When the "Tests ... - in <test>" line is printed, it's not 100% that the relevant xml file is already created. Adding thread.sleep(200) "fixed" the problem on my computer but it's fairly non-deterministic. I was not able to find a more deterministic solution, that's why I would prefer not to include in 7.4
Comment 5 Jesse Glick 2013-08-28 11:46:25 UTC
Bug in Surefire perhaps? I would expect the XML to be created first, then the summary printed. Will you file it?
Comment 6 Milos Kleint 2013-08-28 13:29:29 UTC
I've filed https://jira.codehaus.org/browse/SUREFIRE-1025
Comment 7 Theofanis Oikonomou 2013-11-22 13:11:21 UTC
(In reply to Jesse Glick from comment #5)
> Bug in Surefire perhaps? I would expect the XML to be created first, then
> the summary printed. Will you file it?

This was the root problem in bug 224442. The summary was printed but while trying to create the test in Test Results Window from the xml files I found out that it was not created yet. This was totally un-deterministic though. If surefire gets fixed it would help I guess.

The idea in fixing 224442 was to wait for all the logging to finish and then try to iterate through all the tested classes and "hope" that the xml files would be already created and so their timestamp would be greater from the timestamp of the build start.

With that fix I am always getting all the results in the TRW when running in parallel. I could be wrong though. Jesse could you try a latest build and see if it helps? Thanks
Comment 8 Martin Balin 2016-07-07 08:38:23 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss