[tests] Force tests to print thread dumps when they time out.
authorZoltan Varga <vargaz@gmail.com>
Tue, 29 Mar 2016 18:32:00 +0000 (14:32 -0400)
committerZoltan Varga <vargaz@gmail.com>
Tue, 29 Mar 2016 18:32:09 +0000 (14:32 -0400)
mono/tests/Makefile.am
mono/tests/test-runner.cs

index b410d785f993dba01dbc6b3d765ed64d069dad0e..83b7d196cbd2b12005d107ba4df1eb074b2c175d 100644 (file)
@@ -709,7 +709,7 @@ EXTRA_DIST=test-driver test-runner.cs $(TEST_CS_SRC_DIST) $(TEST_IL_SRC) \
        $(ILASM) -out:$@ $<
 
 %.exe: %.cs TestDriver.dll
-       $(MCS) -r:System.dll -r:System.Xml.dll -r:System.Core.dll -r:TestDriver.dll -out:$@ $<
+       $(MCS) -r:System.dll -r:System.Xml.dll -r:System.Core.dll -r:TestDriver.dll -r:Mono.Posix.dll -out:$@ $<
 
 # mkbundle works on ppc, but the pkg-config POC doesn't when run with make test
 if POWERPC
index e58e009a269117778ad7472a5b7f780a33221539..358be81312cc452d0caa25fcd034069da5baa168 100644 (file)
@@ -33,6 +33,7 @@ using System.Collections.Generic;
 using System.Globalization;
 using System.Xml;
 using System.Text.RegularExpressions;
+using Mono.Unix.Native;
 
 //
 // This is a simple test runner with support for parallel execution
@@ -268,6 +269,13 @@ public class TestRunner
                                                        timedout.Add (data);
                                                }
 
+                                               // Force the process to print a thread dump
+                                               try {
+                                                       Syscall.kill (p.Id, Signum.SIGQUIT);
+                                                       Thread.Sleep (1000);
+                                               } catch {
+                                               }
+
                                                output.Write ("timed out");
 
                                                p.Kill ();