Regres: Adjust constants and include error messages

Reduce the test timeout to 2 minutes, 10 is excessive.

Include the stderr / stdout in the error message when a test crashes.

Up the max proc memory limit from 3GB to 4GB. While our tests haven't started using dramatically more memory, Golang (which wraps the process) seems to use more recently.

Reduce delay in killing a timedout process.

Change-Id: I4634a788a5cae2cb088d70d2f35909a0264600d6
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/35692
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
diff --git a/tests/regres/main.go b/tests/regres/main.go
index fcfeea7..674c7fc 100644
--- a/tests/regres/main.go
+++ b/tests/regres/main.go
@@ -59,7 +59,7 @@
 	dataVersion             = 1
 	changeUpdateFrequency   = time.Minute * 5
 	changeQueryFrequency    = time.Minute * 5
-	testTimeout             = time.Minute * 10 // timeout for a single test
+	testTimeout             = time.Minute * 2  // timeout for a single test
 	buildTimeout            = time.Minute * 10 // timeout for a build
 	dailyUpdateTestListHour = 5                // 5am
 	fullTestListRelPath     = "tests/regres/full-tests.json"
@@ -1241,8 +1241,10 @@
 				Test:      name,
 				Status:    testlist.Crash,
 				TimeTaken: duration,
+				Err:       out,
 			}
 		case shell.ErrTimeout:
+			log.Printf("Timeout for test '%v'\n", name)
 			results <- TestResult{
 				Test:      name,
 				Status:    testlist.Timeout,
diff --git a/tests/regres/shell/shell.go b/tests/regres/shell/shell.go
index c285b0d..7622295 100644
--- a/tests/regres/shell/shell.go
+++ b/tests/regres/shell/shell.go
@@ -30,7 +30,7 @@
 )
 
 // MaxProcMemory is the maximum virtual memory per child process
-var MaxProcMemory uint64 = 3 * 1024 * 1024 * 1024 // 3GB
+var MaxProcMemory uint64 = 4 * 1024 * 1024 * 1024 // 4GB
 
 func init() {
 	// As we are going to be running a number of tests concurrently, we need to
@@ -116,9 +116,8 @@
 
 	select {
 	case <-time.NewTimer(timeout).C:
-		log.Printf("Timeout for process %v\n", c.Process.Pid)
 		c.Process.Signal(syscall.SIGINT)
-		time.Sleep(time.Second * 5)
+		time.Sleep(time.Second * 3)
 		if !c.ProcessState.Exited() {
 			log.Printf("Process %v still has not exited, killing\n", c.Process.Pid)
 			syscall.Kill(-c.Process.Pid, syscall.SIGKILL)