When testing RCP application, the java VM will not terminate

WindowTester allows you to easily create and run unit tests for every GUI they build. It can also be used to generate system level tests.

Moderators: gnebling, Eric Clayberg, Dan Rubel, keertip, Phil Quitslund

When testing RCP application, the java VM will not terminate

Postby eeybye » Tue Sep 04, 2007 3:11 am

Hello

our RCP application consist of one main Shell, which displays read-only data. When modifying the data, we open an application modal Shell.

Testing it with WindowTester works fine, but...

When running it inside Eclipse the first time ( after an Eclipse restart ) the java VM terminates all fine.
But running it more times, the java VM will not terminate.

In the debug view, I can see that it hangs in an Object.wait.

Anyone knows what could cause the problem ??

I'm using Eclipse 3.2.2 with WindowTester SWT 2.2.1 in a link configuration.
eeybye
 
Posts: 22
Joined: Fri Jun 22, 2007 12:34 am
Location: Denmark

Postby eeybye » Tue Sep 04, 2007 3:55 am

Sometimes, I also get an exception when the test is terminating:

Exception in thread "WorkbenchTestable" java.lang.NullPointerException
at org.eclipse.swt.widgets.Display.syncExec(Display.java:3763)
at org.eclipse.ui.internal.testing.WorkbenchTestable.testingFinished(WorkbenchTestable.java:119)
at org.eclipse.pde.internal.junit.runtime.UITestApplication.runTests(UITestApplication.java:108)
at org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(WorkbenchTestable.java:68)
at java.lang.Thread.run(Unknown Source)
eeybye
 
Posts: 22
Joined: Fri Jun 22, 2007 12:34 am
Location: Denmark

Postby Phil Quitslund » Tue Sep 04, 2007 7:13 am

Could you send us the stacktrace? It would be helpful to see what the various threads are up to.

Thanks!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Postby eeybye » Tue Sep 04, 2007 11:50 pm

org.eclipse.core.launcher.Main at localhost:1548
Thread [main] (Running)
Thread [Framework Event Dispatcher] (Running)
Thread [State Saver] (Running)
Thread [Start Level Event Dispatcher] (Running)
Thread [MultiThreadedHttpConnectionManager cleanup] (Running)
Thread [EventQueueThread] (Running)
Thread [RemoteGetEventsThread] (Running)
Thread [Worker-0] (Running)
Thread [WorkbenchTestable] (Running)
Thread [CodePro Background Startup] (Running)
Thread [ReaderThread] (Running)
Thread [Common Core Background Startup] (Running)
Thread [Mercury RPC Thread] (Running)
Thread [JVM Exit listener] (Running)
Thread [AWT-Windows] (Running)
Thread [ModelLockTimer] (Running)


org.eclipse.core.launcher.Main at localhost:1548 (Suspended)
System Thread [Finalizer] (Suspended)
System Thread [Reference Handler] (Suspended)
Thread [main] (Suspended)
System Thread [Signal Dispatcher] (Suspended)
Thread [Framework Event Dispatcher] (Suspended)
Thread [Start Level Event Dispatcher] (Suspended)
Thread [MultiThreadedHttpConnectionManager cleanup] (Suspended)
Thread [EventQueueThread] (Suspended)
Thread [RemoteGetEventsThread] (Suspended)
Thread [Worker-0] (Suspended)
Thread [WorkbenchTestable] (Suspended)
Thread [CodePro Background Startup] (Suspended)
Thread [ReaderThread] (Suspended)
Thread [Mercury RPC Thread] (Suspended)
Thread [JVM Exit listener] (Suspended)
Thread [AWT-Windows] (Suspended)
System Thread [Java2D Disposer] (Suspended)
Thread [ModelLockTimer] (Suspended)


Thread [main] (Suspended)
Object.wait(long) line: not available [native method]
RemotePluginTestRunner(Object).wait() line: not available
RemotePluginTestRunner(RemoteTestRunner).waitForReruns() line: 404
RemotePluginTestRunner(RemoteTestRunner).run() line: 388
RemotePluginTestRunner.main(String[]) line: 58
UITestApplication$1.run() line: 105
RunnableLock.run() line: 35
UISynchronizer(Synchronizer).runAsyncMessages(boolean) line: 123
Display.runAsyncMessages(boolean) line: 3325
Display.readAndDispatch() line: 2971
Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 1930
Workbench.runUI() line: 1894
Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 422
PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149
Application.run(Object) line: 137
UITestApplication.run(Object) line: 45
PlatformActivator$1.run(Object) line: 78
EclipseAppLauncher.runApplication(Object) line: 92
EclipseAppLauncher.start(Object) line: 68
EclipseStarter.run(Object) line: 400
EclipseStarter.run(String[], Runnable) line: 177
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: not available
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not available
Method.invoke(Object, Object...) line: not available
Main.invokeFramework(String[], URL[]) line: 336
Main.basicRun(String[]) line: 280
Main.run(String[]) line: 977
Main.main(String[]) line: 952
eeybye
 
Posts: 22
Joined: Fri Jun 22, 2007 12:34 am
Location: Denmark

Postby Phil Quitslund » Wed Sep 12, 2007 2:59 pm

Hmmmmm...

What is the Mercury Thread doing?

Are there any plugins you can remove from the launch configuration (and still properly test your application)? Stripping out all unnecessary plugins might help identify the culprit.

If you can't remove any plugins, could you describe your plugin dependencies?
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Postby eeybye » Thu Sep 13, 2007 5:28 am

I have already stripped all unnecessary plugins.

The Mercury thread comes from QuickTest Pro, which I had installed.

I think the problem with the non-terminating VM comes from having too many wait conditions.

The exception comes from (I guess) not having the right wait conditions whereby the application terminates too quickly causing the syncExec to fail because the display was disposed.

Now after carefully inserted the right number of wait conditions, I have no problems anymore. I think though WindowTester is a bit fragile concerning the fact, that the extra wait conditions wasn't caught by the recording function.
eeybye
 
Posts: 22
Joined: Fri Jun 22, 2007 12:34 am
Location: Denmark

Postby Phil Quitslund » Thu Sep 13, 2007 7:23 am

Thanks for following up. Wait conditions should really not cause a deadlock but you might have stumbled across a bug. If you have any insights that might help us track it down, please submit a report to:

wintest-support@instantiations.com

We're always trying to make the product more stable.

Thanks again!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest