[kaffe] CVS kaffe (jim): Added "killer" process to regression tests to kill tests

Kaffe CVS cvs-commits at kaffe.org
Sun Aug 17 23:37:02 PDT 2003


PatchSet 3960 
Date: 2003/08/18 06:34:45
Author: jim
Branch: HEAD
Tag: (none) 
Log:
Added "killer" process to regression tests to kill tests
that get hung up (after TIMEOUT seconds).

Members: 
	ChangeLog:1.1558->1.1559 
	test/regression/Makefile.am:1.80->1.81 
	test/regression/Makefile.in:1.133->1.134 
	test/regression/TestScript.in:1.37->1.38 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1558 kaffe/ChangeLog:1.1559
--- kaffe/ChangeLog:1.1558	Sun Aug 17 06:31:12 2003
+++ kaffe/ChangeLog	Mon Aug 18 06:34:45 2003
@@ -1,6 +1,18 @@
 2003-08-16  Jim Pick  <jim at kaffe.org>
 
 	* test/regression/TestScript.in:
+	Add TIMEOUT variable and process to kill hung tests.
+
+	* test/regression/Makefile.am:
+	Suppress shell job control messages caused by killer
+	process.
+
+	* test/regression/Makefile.in:
+	Regenerated.
+
+2003-08-16  Jim Pick  <jim at kaffe.org>
+
+	* test/regression/TestScript.in:
 	Remove -noverify, since it's turned on globally now.
 
 2003-08-16  Guilhem Lavaux <guilhem at kaffe.org>
Index: kaffe/test/regression/Makefile.am
diff -u kaffe/test/regression/Makefile.am:1.80 kaffe/test/regression/Makefile.am:1.81
--- kaffe/test/regression/Makefile.am:1.80	Thu Jul 17 14:30:11 2003
+++ kaffe/test/regression/Makefile.am	Mon Aug 18 06:34:46 2003
@@ -8,7 +8,9 @@
 
 SETUP_ENVIRONMENT = env `. $(top_builddir)/BUILD_ENVIRONMENT; sed 's/.*export \(.*\)/echo \1=$$\1/' < $(top_builddir)/BUILD_ENVIRONMENT | sh`
 
-TESTS_ENVIRONMENT = $(SETUP_ENVIRONMENT) $(SHELL) TestScript
+# Redirect errors to /dev/null to avoid annoying job control
+# messages from shell when killing tests due to timeouts
+TESTS_ENVIRONMENT = $(SETUP_ENVIRONMENT) $(SHELL) TestScript 2> /dev/null
 
 ALWAYS_TESTS = \
 	$(SIMPLE_HEALTH_CHECK) \
Index: kaffe/test/regression/Makefile.in
diff -u kaffe/test/regression/Makefile.in:1.133 kaffe/test/regression/Makefile.in:1.134
--- kaffe/test/regression/Makefile.in:1.133	Thu Jul 31 22:47:09 2003
+++ kaffe/test/regression/Makefile.in	Mon Aug 18 06:34:46 2003
@@ -243,7 +243,9 @@
 
 SETUP_ENVIRONMENT = env `. $(top_builddir)/BUILD_ENVIRONMENT; sed 's/.*export \(.*\)/echo \1=$$\1/' < $(top_builddir)/BUILD_ENVIRONMENT | sh`
 
-TESTS_ENVIRONMENT = $(SETUP_ENVIRONMENT) $(SHELL) TestScript
+# Redirect errors to /dev/null to avoid annoying job control
+# messages from shell when killing tests due to timeouts
+TESTS_ENVIRONMENT = $(SETUP_ENVIRONMENT) $(SHELL) TestScript 2> /dev/null
 
 ALWAYS_TESTS = \
 	$(SIMPLE_HEALTH_CHECK) \
Index: kaffe/test/regression/TestScript.in
diff -u kaffe/test/regression/TestScript.in:1.37 kaffe/test/regression/TestScript.in:1.38
--- kaffe/test/regression/TestScript.in:1.37	Sun Aug 17 06:31:13 2003
+++ kaffe/test/regression/TestScript.in	Mon Aug 18 06:34:47 2003
@@ -17,6 +17,7 @@
 # If you want to use jikes as default compiler for the regression tests uncomment the line below.
 #test -z "@JIKES@" || : ${JIKES="@JIKES@ -nowarn"}
 : ${JAVAC=${JIKES-"$JAVA at.dms.kjc.Main"}" -classpath \".$PATHSEP$SRCDIR$PATHSEP$CLASSPATH\""}
+: ${TIMEOUT=300}
 overallerror=0
 error=0
 
@@ -67,8 +68,15 @@
 	RESULT="$1.fail"
 	TMPRESULT="$1.tmp"
 	$VERBOSE $JAVA $*
-	$JAVA $* >$TMPRESULT 2>&1
+	$JAVA $* >$TMPRESULT 2>&1 &
 	error=$?
+	pid=$!
+	$VERBOSE "Background pid: $pid"
+	(sleep $TIMEOUT; echo "Timeout - $TIMEOUT seconds - killed" >> $TMPRESULT; kill $pid) &
+	killerpid=$!
+	$VERBOSE "Killer process pid: $killerpid with timeout of $TIMEOUT seconds"
+	wait $pid
+	kill $killerpid
 	if test "x$SORT" = "xyes"; then
 	    # grep will take care of stripping \r from DOS-like output
 	    sort $TMPRESULT | grep '.*' > $RESULT




More information about the kaffe mailing list