Paused test still consumes 60% CPU usage

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

Paused test still consumes 60% CPU usage

Postby keico » Fri Mar 04, 2011 12:14 pm


I have a need to launch the WindowTeseter test and pause the test for some period of time. The way I do it is to put the main thread to sleep with the
following call:
Code: Select all

Please refer attached source and test code for details.
During the time the test is being paused, I can interact with the main swing application as if I launch it as a standalone application. This is a great.
However, while the test is being paused I realize that it still consumes up to 60% of my CPU usage. Below is thread dump result which shows the thread that may be involved:

"main" prio=6 tid=0x003a7000 nid=0x1650 runnable [0x0090f000]
java.lang.Thread.State: RUNNABLE
at java.lang.Object.hashCode(Native Method)
at java.util.WeakHashMap.get(Unknown Source)
at abbot.tester.WindowTracker.getRootWindows(
- locked <0x27fbf878> (a java.util.WeakHashMap)
at abbot.finder.AWTHierarchy.getRoots(
at com.windowtester.runtime.swing.internal.junit.SwingExecutionMonitor.terminateWaitForFinish(
at com.windowtester.internal.runtime.junit.core.AbstractExecutionMonitor.waitUntilFinished(
at com.windowtester.internal.runtime.junit.core.SequenceRunner.waitUntilFinished(
at com.windowtester.internal.runtime.junit.core.SequenceRunner.exec(
at com.windowtester.runtime.common.UITestCaseCommon.runUITest(
at com.windowtester.runtime.common.UITestCaseCommon.runBare(
at junit.framework.TestResult$1.protect(
at junit.framework.TestResult.runProtected(
at junit.framework.TestSuite.runTest(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(

Can someone look into this issue and let me know how to resolve it? I appreciate your time and effort!
Thanks in advance!
Test code
(413 Bytes) Downloaded 6 times
Source code
(5.45 KiB) Downloaded 4 times
Posts: 21
Joined: Wed Jan 05, 2011 7:37 am

Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest