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 202777 - Test Results window claims there is a failure but does not show it
Summary: Test Results window claims there is a failure but does not show it
Status: RESOLVED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Test Runner (show other bugs)
Version: 7.1
Hardware: All All
: P2 normal with 1 vote (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords: THREAD
: 202680 (view as bug list)
Depends on: 211336
Blocks:
  Show dependency tree
 
Reported: 2011-09-28 14:09 UTC by Jesse Glick
Modified: 2012-04-17 14:28 UTC (History)
2 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 2011-09-28 14:09:06 UTC
Often when showing test results from deadlock, "No test passed, 1 test failed" is displayed at the top of the window, and the error bar ("0.00 %") is animated, but no test information appears. Meanwhile the Output Window gets the full information including stack trace (and its title bar is unboldfaced so it seems quiescent).
Comment 1 Jesse Glick 2011-10-18 23:34:09 UTC
*** Bug 202680 has been marked as a duplicate of this bug. ***
Comment 2 Tomas Danek 2011-11-16 14:22:24 UTC
FYI: was able to reproduce on windows 7 box with these steps:

- created anagram game
- made it versioned in Git
- created new job fo local hudson
- added new JUnit test with failing test method (just assert false : "foo")
- started job from IDE
- got bubble notification with test failures ---> output was empty

hudson itself not running on some "space in path" location. Used version 2.1.2
Comment 3 Jesse Glick 2011-11-16 15:41:49 UTC
Happens sometimes, but not consistently reproducible.
Comment 4 Jesse Glick 2011-11-16 16:07:59 UTC
Log output when working correctly:

FINER [org.netbeans.modules.hudson.api.ConnectionBuilder]: Trying to open http://localhost:8080/job/AnagramGame/2/testReport/api/xml?xpath=//suite[case/errorStackTrace]&wrapper=failures
FINER [org.netbeans.modules.hudson.api.ConnectionBuilder]:   => 200
FINE [org.netbeans.modules.hudson.ui.actions.ShowFailures]: got com.toy.anagrams.lib.BrokenTest.testHello as FAILED
FINE [org.netbeans.modules.gsf.testrunner.api.Manager]: Finishing session: org.netbeans.modules.gsf.testrunner.api.TestSession@9ec4a6
FINE [org.netbeans.modules.gsf.testrunner.api.ResultDisplayHandler]: Invoking: displayMsg with param: Running...
FINE [org.netbeans.modules.gsf.testrunner.api.RootNode]: Setting display name to: 'Running...'. Total tests run: 0. Session finished: false
FINE [org.netbeans.modules.gsf.testrunner.api.ResultDisplayHandler]: Invoking: displaySuiteRunning with param: com.toy.anagrams.lib.BrokenTest
FINE [org.netbeans.modules.gsf.testrunner.api.ResultDisplayHandler]: Invoking: displayReport with param: org.netbeans.modules.gsf.testrunner.api.Report@a8df4f
FINE [org.netbeans.modules.gsf.testrunner.api.RootNode]: Setting display name to: 'No test passed, 1 test failed.(0.0 s) Running...'. Total tests run: 1. Session finished: false
FINE [org.netbeans.modules.gsf.testrunner.api.ResultDisplayHandler]: Invoking: displayMsgSessionFinished with param: null
FINE [org.netbeans.modules.gsf.testrunner.api.RootNode]: Setting display name to: 'No test passed, 1 test failed.(0.0 s)'. Total tests run: 1. Session finished: true

and when not:

FINER [org.netbeans.modules.hudson.api.ConnectionBuilder]: Trying to open http://localhost:8080/job/AnagramGame/2/testReport/api/xml?xpath=//suite[case/errorStackTrace]&wrapper=failures
FINER [org.netbeans.modules.hudson.api.ConnectionBuilder]:   => 200
FINE [org.netbeans.modules.hudson.ui.actions.ShowFailures]: got com.toy.anagrams.lib.BrokenTest.testHello as FAILED
FINE [org.netbeans.modules.gsf.testrunner.api.Manager]: Finishing session: org.netbeans.modules.gsf.testrunner.api.TestSession@1c24931
FINE [org.netbeans.modules.gsf.testrunner.api.RootNode]: Setting display name to: 'No test passed, 1 test failed.(0.0 s)'. Total tests run: 1. Session finished: false

The key to reproducing is that the Test Results window must initially be closed. I think the problem is that the report is displayed after the session is marked finished, due to threading in gsf.testrunner.
Comment 5 Jesse Glick 2011-11-16 16:30:24 UTC
Specifically, I think some events are routed through displayInDispatchThread whereas others are not; the result is that events are received by the GUI component in a different order than they were sent from the Manager. The first difference I can find is that if TR was initially not open, ResultDisplayHandler.displayMessage returns early because treePanel == null. It is supposed to defend against this in setTreePanel by showing the message retroactively, but I guess that is not working.
Comment 6 Jesse Glick 2012-04-10 18:08:58 UTC
In recent dev builds I have seen this a lot but from running tests locally, not only from Hudson.
Comment 7 Jesse Glick 2012-04-10 18:15:10 UTC
In fact seems to happen most of the time now (20120410-c5d030bb204a), perhaps triggered by recent changes in Test Results focus policy. It makes the TR window useless since it only displays a summary but no details.
Comment 8 Theofanis Oikonomou 2012-04-12 08:55:58 UTC
Jesse thank you for the evaluation.

You are correct that recent changes in TRW focus policy made the problem more obvious. The problem was that if the TRW was not really visible no nodes were added to the tree and so when you opened it from the notification bubble or from the Window->Output menu only a summary was shown. 

I think this fixes the problem: http://hg.netbeans.org/core-main/rev/91b93f3392c3

Could someone please verify it? Thank you
Comment 9 Jesse Glick 2012-04-12 23:26:28 UTC
Fix seems to be working from what I can see so far.
Comment 10 Quality Engineering 2012-04-13 09:52:08 UTC
Integrated into 'main-golden', will be available in build *201204130400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/91b93f3392c3
User: Theofanis Oikonomou <theofanis@netbeans.org>
Log: Issue #202777 - Test Results window claims there is a failure but does not show it