Dump all threads when testcase times out.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Fri, 06 Jun 2014 10:29:27 +0200
changeset 237 8229efa1f621
parent 236 475480551293
child 238 c5047b0ed211
Dump all threads when testcase times out. This could help to identify a reason for timeout, i.e., whether the testcase takes a long time or if it got stuck is some kind of deadlock.
reports/Builder__TestReport.st
--- a/reports/Builder__TestReport.st	Fri Jun 06 02:23:32 2014 +0200
+++ b/reports/Builder__TestReport.st	Fri Jun 06 10:29:27 2014 +0200
@@ -427,11 +427,13 @@
     timeouted := false.
     thread := [ super runCase:aTestCase debugged: debugged ] newProcess.
     thread addExitAction:[sema signal].
+    thread name: ('Testcase execution thread (%1)' bindWith: aTestCase).
     thread resume.
 
     Transcript show: 'waiting for child...'.
     (sema waitWithTimeout:timeout) isNil ifTrue: [
         Transcript show: 'timeout...'.
+        stack := String streamContents:[:s |  ReportRunner dumpProcessesOn:s ].
         thread terminate.
         timeouted := true.
         Transcript show: 'killed...'.
@@ -440,7 +442,6 @@
     etime := OperatingSystem getMillisecondTime.
     timeouted ifTrue:[
         error := TimeoutError new messageText: 'Timed out'.
-        stack := 'Timed out'.
         outcome result: TestResult stateError.
         format 
             writeTestCase: aTestCase outcome: outcome 
@@ -454,7 +455,7 @@
     Transcript cr.
 
     "Created: / 12-01-2012 / 17:42:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 06-06-2014 / 00:55:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-06-2014 / 09:19:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 unixForkCase:aTestCase debugged: debugged timeout: timeout