summaryrefslogtreecommitdiffhomepage
path: root/test/runtimes/runner.go
diff options
context:
space:
mode:
authorTing-Yu Wang <anivia@google.com>2020-02-03 15:30:28 -0800
committergVisor bot <gvisor-bot@google.com>2020-02-03 15:42:21 -0800
commite7846e50f2df070a15dd33235b334e2223f715f3 (patch)
tree338147199b788f2ccd74f31abe25404848183bd1 /test/runtimes/runner.go
parent80ce7f253783feac041ef197b144d920e57955ec (diff)
Reduce run time for //test/syscalls:socket_inet_loopback_test_runsc_ptrace.
* Tests are picked for a shard differently. It now picks one test from each block, instead of picking the whole block. This makes the same kind of tests spreads across different shards. * Reduce the number of connect() calls in TCPListenClose. PiperOrigin-RevId: 293019281
Diffstat (limited to 'test/runtimes/runner.go')
-rw-r--r--test/runtimes/runner.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/test/runtimes/runner.go b/test/runtimes/runner.go
index bec37c69d..ddb890dbc 100644
--- a/test/runtimes/runner.go
+++ b/test/runtimes/runner.go
@@ -20,7 +20,6 @@ import (
"flag"
"fmt"
"io"
- "log"
"os"
"sort"
"strings"
@@ -101,17 +100,15 @@ func getTests(d dockerutil.Docker, blacklist map[string]struct{}) ([]testing.Int
// shard.
tests := strings.Fields(list)
sort.Strings(tests)
- begin, end, err := testutil.TestBoundsForShard(len(tests))
+ indices, err := testutil.TestIndicesForShard(len(tests))
if err != nil {
return nil, fmt.Errorf("TestsForShard() failed: %v", err)
}
- log.Printf("Got bounds [%d:%d) for shard out of %d total tests", begin, end, len(tests))
- tests = tests[begin:end]
var itests []testing.InternalTest
- for _, tc := range tests {
+ for _, tci := range indices {
// Capture tc in this scope.
- tc := tc
+ tc := tests[tci]
itests = append(itests, testing.InternalTest{
Name: tc,
F: func(t *testing.T) {