Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-releng-dev] Stacktrace for DNFs in consolelog

The patch at https://bugs.eclipse.org/bugs/attachment.cgi?id=192770&action=""> pretty much sums it up:

In the Eclipse test framework, the EclipseTestRunner parses the command line and invokes JUnit in the test VM.
I just added another command line argument "-timeout <millis>", and then I start a deamon thread that dumps the stack 30s before the timeout elapses.
In our case, the timeout is given by the Ant script that calls <java fork="true" timeout="${timeout}" ...>.

I've been thinking about this for quite some time, and I would have loved to put it into the Ant task itself (the one which kills the sub-process after the timeout). Unfortunately, I found no good way to do that. Since you cannot easily add code to the target VM from the outside, I wanted to use the jstack executable to get the dumps. But it's not easy to find this executable on all platforms (might not even be present if you're just running with a JRE), and there's also no official way to get the process ID from a java.lang Process.

An alternative technique could be to just wrap the main class, i.e. replace it with another class that sets up the timer, removes the timeout argument from the command line, and then calls the original main class.

HTH,
Markus



From: David M Williams <david_williams@xxxxxxxxxx>
To: "Eclipse platform release engineering list." <platform-releng-dev@xxxxxxxxxxx>
Date: 2011-04-20 17:14
Subject: Re: [platform-releng-dev] Stacktrace for DNFs in consolelog





Hey Markus, do you have any code/scripts/techniques/pointers that others could use to "get stackdumps shortly before a plug-in test VM gets killed in automated tests". This is something I've always wanted to do in WTP, but never had the time ... so, if you have any time-saving tips, that'd be great! I'm sure for many.

Thanks,


Inactive hide details for Markus Keller ---04/20/2011 10:59:03 AM---As a side effect of the efforts to track down  https://bugsMarkus Keller ---04/20/2011 10:59:03 AM---As a side effect of the efforts to track down https://bugs.eclipse.org/342053 , you now get stackdu

From:
Markus Keller <markus_keller@xxxxxxxxxx>
To:
"Eclipse platform release engineering list." <platform-releng-dev@xxxxxxxxxxx>
Date:
04/20/2011 10:59 AM
Subject:
[platform-releng-dev] Stacktrace for DNFs in consolelog
Sent by:
platform-releng-dev-bounces@xxxxxxxxxxx




As a side effect of the efforts to track down
https://bugs.eclipse.org/342053 , you now get stackdumps shortly before a plug-in test VM gets killed in automated tests.

E.g. for the failing
org.eclipse.debug.tests_win32.win32.x86_6.0 in the N-build, the Console Output Log
http://download.eclipse.org/eclipse/downloads/drops/N20110419-2000/testresults/consolelogs/win32-6.0_consolelog.txt
now contains:


   [echo] Running org.eclipse.debug.tests.AutomatedSuite. Result file: C:\buildtest\N20110419-2000\eclipse-testing/results/win32.win32.x86_6.0/org.eclipse.debug.tests.AutomatedSuite.xml.
  [java] EclipseTestRunner almost reached timeout '7200000'.
  [java] Thread dump at 2011-04-20 06:17:47 -0400:

...
  [java] java.lang.Exception: main
  [java]                  at org.eclipse.swt.internal.win32.OS.WaitMessage(Native Method)
  [java]                  at org.eclipse.swt.widgets.Display.sleep(Display.java:4650)
  [java]                  at org.eclipe.debug.tests.viewer.model.ContentTests.testLabelUpdatesCompletedOutOfSequence1(ContentTests.java:191)
  [java]                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  [java]                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  [java]                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  [java]                  at java.lang.reflect.Method.invoke(Method.java:597)
  [java]                  at junit.framework.TestCase.runTest(TestCase.java:168)
  [java]                  at org.eclipe.debug.tests.viewer.model.ContentTests.runTest(ContentTests.java:84)
...

   [java] FocusControl:
  [java] Tree {}
  [java] Shell {}
  [java] Shells:
  [java] visible: Shell {Java - Eclipse SDK}
  [java] visible: Shell {}


While this doesn't explain why the tests hung up, it at least gives a hint at where to start investigating, and it lists the Focus Control (together with its ancestors) and the open Shells. The whole dump is repeated 2 seconds later. Since the code that prints the SWT infos uses "display.syncExec(..)", this may or may not influence a hung main thread.


Note that the org.eclipse.test plug-in has not been tagged yet with this change, that's why you only see this in the N-build.


Markus



BTW: The
jdt.ui.tests failures have been fixed in HEAD.

From: Kim_Moir@xxxxxxxxxx
To: platform-releng-dev@xxxxxxxxxxx
Date: 2011-04-20 13:48
Subject: [platform-releng-dev] [eclipse-build]Build N20110419-2000 (Timestamp: 201104192000):Build is complete. Test failures/errors occurred.






Build N20110419-2000 (Timestamp: 201104192000):  Automated JUnit testing is complete.  Test failures/errors occurred in the following:  

org.eclipse.debug.tests_win32.win32.x86_6.0
org.eclipse.jdt.ui.tests_linux.gtk.x86_6.0
org.eclipse.jdt.ui.tests_macosx.cocoa.x86_5.0
org.eclipse.jdt.ui.tests_win32.win32.x86_6.0
org.eclipse.ui.tests_win32.win32.x86_6.0


HTTP Download:


http://download.eclipse.org/eclipse/downloads/drops/N20110419-2000


Test result files (hint: copy/paste or drag-and-drop to the JUnit view):


http://download.eclipse.org/eclipse/downloads/drops/N20110419-2000/testresults/xml/org.eclipse.debug.tests_win32.win32.x86_6.0.xml
http://download.eclipse.org/eclipse/downloads/drops/N20110419-2000/testresults/xml/org.eclipse.jdt.ui.tests_linux.gtk.x86_6.0.xml
http://download.eclipse.org/eclipse/downloads/drops/N20110419-2000/testresults/xml/org.eclipse.jdt.ui.tests_macosx.cocoa.x86_5.0.xml
http://download.eclipse.org/eclipse/downloads/drops/N20110419-2000/testresults/xml/org.eclipse.jdt.ui.tests_win32.win32.x86_6.0.xml
http://download.eclipse.org/eclipse/downloads/drops/N20110419-2000/testresults/xml/org.eclipse.ui.tests_win32.win32.x86_6.0.xml

_______________________________________________
platform-releng-dev mailing list
platform-releng-dev@xxxxxxxxxxx

https://dev.eclipse.org/mailman/listinfo/platform-releng-dev

_______________________________________________
platform-releng-dev mailing list
platform-releng-dev@xxxxxxxxxxx

https://dev.eclipse.org/mailman/listinfo/platform-releng-dev
_______________________________________________
platform-releng-dev mailing list
platform-releng-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-releng-dev



Back to the top