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 27064 - Windows ext browser DDE server does not terminate gracefully under XTest run
Summary: Windows ext browser DDE server does not terminate gracefully under XTest run
Status: RESOLVED WONTFIX
Alias: None
Product: ide
Classification: Unclassified
Component: Extbrowser (show other bugs)
Version: 3.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Martin Grebac
URL: http://nagoya.apache.org/bugzilla/sho...
Keywords: T9Y
Depends on:
Blocks:
 
Reported: 2002-09-05 17:19 UTC by ssffleming
Modified: 2004-01-19 17:07 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
AntRunner output (24.69 KB, text/plain)
2003-06-13 14:56 UTC, _ rkubacki
Details
AntRunner output (26.25 KB, text/plain)
2003-06-25 10:12 UTC, _ rkubacki
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ssffleming 2002-09-05 17:19:12 UTC
We are seeing problems with termination of the IDE under XTest on 2 CPU XP systems.
The problem seems to be that the external browser DDE server does not terminate
gracefully.  XTest hangs waiting for tasks to complete.  Closing the external browser
launched by the IDE clears the hang causing the IDE to exit gracefully and XTest to
terminate.  It appears that there needs to be a way for the DDE server to close the
connection to the external browser and terminate when the IDE is terminating under
XTest control.

This causes problems for automated tests.  We have a workaround which is to
under automated test control "exec/kill" the external browsers, but this is not so good long 
term
because it assumes the test gets to the point where the browsers are "killed".
Comment 1 Sergey Soldatov 2002-09-06 12:28:54 UTC
I've got the same problem on one CPU PC under Win2000SP3
Comment 2 _ rkubacki 2002-09-06 15:24:42 UTC
What task is it waiting for? Can you attach ide.log?

Possible way how to fix this is to add some entry points for
uninitialization of browser into extbrowser module that will reset DDE
communication (namely call DdeUninitialize or what is correct name).
Comment 3 ssffleming 2002-09-06 18:09:38 UTC
This is kind of a funny one.  All IDE tasks get terminated ok, at least as far as the
Execution window shows.  The test case I am running creates a Web Services test client
which launches an external browser when executed.  Your fix sounds promising.  The
test case I have is pretty complex.  If you like I would be happy to take a pre-integration
jar with a fix candidate and test it for you.  But if it needs to be implemented by the
task using DDE, see discussion in next paragraph.

As an aside, I think that the Web Services test client doesn't really need to maintain
the DDE connection.  It seems like all it does is open the web browser to one URL and then
it is done.  I was planning to talk with the test client developers as well, but I started
out with the core because it seemed like a more general solution, but I am not sure how
shutdown/task logic works in NB.  If I am correct about the
web services test client logic then they would presumeably want an API something like
"I am done now" which would terminate DDE.  This is probably also useful if a user was doing
lots of test client executions, since it would free up resources that were no longer needed.
Comment 4 _ rkubacki 2002-10-04 16:12:44 UTC
I haven't time to implement any hook. What about disabling extbrowser
module during your tests? Or set IDe browser to Swing browser before
performing the test? Something like 

import org.netbeans.core.IDESettings;
import org.netbeans.core.ui.SwingBrowser;
import org.openide.awt.HtmlBrowser;
import org.openide.util.Lookup;

...

HtmlBrowser.Factory f =
(SwingBrowser)Lookup.getDefault().lookup(SwingBrowser.class);
IDESettings s = (IDESettings)IDESettings.findObject(IDESettings.class,
true);
s.setWWWBrowser (f);


Or even better solution is to use you own HtmlBrowser.Factory that
will create your HtmlBrowser.Impl. This will give you possibility to
check content of stream when setURL is called
Comment 5 ssffleming 2002-10-04 17:14:10 UTC
Hi Radim,

Unfortunately the browser is opened as part of the web services 
Test Client function we are testing...
Comment 6 _ rkubacki 2002-10-04 17:23:30 UTC
Yes, that's OK. I assume that it uses TopManager.showUrl or new
org.openide.awt.HtmlBrowser. Attached code does the same as you would
go into Tools | Options and change your settings for web browser to
Swing HTML browser.
Comment 7 _ rkubacki 2003-02-21 15:28:16 UTC
Steve is it still a problem (using latest S1S builds)?

What task is XTest waiting for?
Comment 8 _ rkubacki 2003-02-27 14:29:54 UTC
Since there is no response and this is not user problem I am closing
this as wontfix.
Comment 9 ssffleming 2003-04-29 17:29:51 UTC
Problem is still there, we need a fix ASAP after
Nevada.  Raising priority since tests cannot run
unattended until this is fixed.
Comment 10 _ rkubacki 2003-04-29 17:41:30 UTC
where can I find test sources to reproduce this? Did anyone tried
suggested solution?
Comment 11 ssffleming 2003-04-29 20:57:08 UTC
Just to make more clear, we're interested in this being fixed
in a post Nevada release.  Setting release to future.  Since
there is some urgency, setting priority back to P2.  Problem
is seen on all windows platforms, not just XP.

Test includes browsers, so can't disable this function.
Can't use swing browser because we are testing browsers (such as Netscape/Explorer).
Comment 12 _ rkubacki 2003-04-30 14:05:01 UTC
Should try to call DdeUnitialize during module closing.
Comment 13 psuk 2003-04-30 16:00:44 UTC
Requesting waiver for S1S5.
Comment 14 ssffleming 2003-04-30 17:38:20 UTC
drop down to P3, will raise to P2 after Nevada FCS.
Send note to Honza regarding dashboard should filter
out bugs not targetted for Nevada.
Comment 15 _ rkubacki 2003-05-27 14:47:29 UTC
Steve, can you give me advice how to run your tests to reproduce this
problem?

Another questions: is the browser launched from IDE or separately?
Does the behaviour differ? Is the IDE process finished? If it is not
can you attach tread dump?

The native sources release DDE though we can uncomment atexit(ClearDDE).
Comment 16 ssffleming 2003-05-27 18:07:27 UTC
Hi Radim,

Here is a test for you to run.  If you have any difficulty, let me
know and I'll give some pointers.  You may have some DNS problems.
If so you could edit your localhosts file to use the following:
humor 129.149.75.62
Humor is a machine that is running an application server used by the test
for deploying a web service.

Steps:
1.  Checkout closed source cvs module "jot"
2.  edit file jot/testws/src/ws/WebServiceSimple.java and comment out line 247
This is a workaround that attempts to kill the browser when the test is done.
2.  cd jot/test
3.  edit build.xml to set property "netbeans.home" for where you have build S1S
4.  run "ant ws"
This creates and deploys a web service and a test client.  When the test client is
executed it automatically invokes a web browser via DDE.
Comment 17 ssffleming 2003-06-05 17:16:59 UTC
changing version to current, putting priority back to P2 (it was lowered to help out
Nevada dashboard glitches)
Comment 18 _ rkubacki 2003-06-13 14:56:38 UTC
Created attachment 10683 [details]
AntRunner output
Comment 19 _ rkubacki 2003-06-13 14:59:58 UTC
Steve, I can't run the test due to SQLException (see attached output).
Any help what needs to be configured?
Comment 20 _ rkubacki 2003-06-25 10:12:54 UTC
Created attachment 10792 [details]
AntRunner output
Comment 21 _ rkubacki 2003-06-25 10:15:40 UTC
I've updated my hosts file with new IP address of humor but still
can't execute tests due to NCDFE
org/apache/xml/serialize/BaseMarkupSerializer
Any idea what is wrong? I have fresh sources taken from trunk.
Comment 22 _ rkubacki 2003-07-03 14:16:06 UTC
Steve, is it possible that the problem you have reported is related to
Ant bug 5003 that is mentioned on our xtest.netbeans.org site? Do you
run your tests will patches applied?

BTW: another possible way how to avoid this is to check for
netbeans.full.hack property and kill the browser on IDE shutdown. It
is not very nice but can work.
Comment 23 _ rkubacki 2003-08-13 14:19:45 UTC
I get no feedback on my last comment written a month ago. Is this
still a problem?
Comment 24 _ rkubacki 2003-10-07 15:37:27 UTC
Is this still a problem?
Comment 25 ssffleming 2003-10-29 23:03:18 UTC
Looks like we may be seeing this on Rave.
Comment 26 Martin Brehovsky 2003-11-03 16:50:07 UTC
If you are using Ant 1.4.*, make sure you incorporate a patch, which
fixes stdout/stderr handling problems. More information on XTest and
this is here:
<http://xtest.netbeans.org/XTest_installation.html#trouble_shooting>

and Ant bug and patch is described here:

<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5003>

Comment 27 Martin Grebac 2004-01-13 21:19:08 UTC
Is this still a problem? Did you try the Ant patch? Without response
I'm gonna close the issue as invalid.
Comment 28 Martin Grebac 2004-01-19 17:07:14 UTC
No response - closing.