OSDN Git Service

Regres: Changes to reduce timeouts
authorBen Clayton <bclayton@google.com>
Wed, 3 Apr 2019 11:03:28 +0000 (12:03 +0100)
committerBen Clayton <bclayton@google.com>
Wed, 3 Apr 2019 12:28:09 +0000 (12:28 +0000)
* Shuffle the test lists to mix heavy-load tests with lighter ones.
* Bump the test timeout to 10 minutes.

Change-Id: I886b08993a39ce78fd198ac4a1ce06f7378dbb20
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28349
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
tests/regres/main.go

index 5c885c4..257167d 100644 (file)
@@ -31,6 +31,7 @@ import (
        "flag"
        "fmt"
        "log"
+       "math/rand"
        "os"
        "os/exec"
        "path/filepath"
@@ -57,7 +58,7 @@ const (
        dataVersion             = 1
        changeUpdateFrequency   = time.Minute * 5
        changeQueryFrequency    = time.Minute * 5
-       testTimeout             = time.Minute *  // timeout for a single test
+       testTimeout             = time.Minute * 10 // timeout for a single test
        buildTimeout            = time.Minute * 10 // timeout for a build
        dailyUpdateTestListHour = 5                // 5am
        fullTestListRelPath     = "tests/regres/full-tests.json"
@@ -783,8 +784,15 @@ func (t *test) run(testLists testlist.Lists) (*CommitTestResults, error) {
                        }()
                }
 
+               // Shuffle the test list.
+               // This attempts to mix heavy-load tests with lighter ones.
+               shuffled := make([]string, len(list.Tests))
+               for i, j := range rand.New(rand.NewSource(42)).Perm(len(list.Tests)) {
+                       shuffled[i] = list.Tests[j]
+               }
+
                // Hand the tests to the deqpTestRoutines.
-               for _, t := range list.Tests {
+               for _, t := range shuffled {
                        tests <- t
                }