summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/syscall_test_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/syscalls/syscall_test_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/syscalls/syscall_test_runner.go')
-rw-r--r--test/syscalls/syscall_test_runner.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/syscalls/syscall_test_runner.go b/test/syscalls/syscall_test_runner.go
index b9fd885ff..ae342b68c 100644
--- a/test/syscalls/syscall_test_runner.go
+++ b/test/syscalls/syscall_test_runner.go
@@ -450,17 +450,16 @@ func main() {
}
// Get subset of tests corresponding to shard.
- begin, end, err := testutil.TestBoundsForShard(len(testCases))
+ indices, err := testutil.TestIndicesForShard(len(testCases))
if err != nil {
fatalf("TestsForShard() failed: %v", err)
}
- testCases = testCases[begin:end]
// Run the tests.
var tests []testing.InternalTest
- for _, tc := range testCases {
+ for _, tci := range indices {
// Capture tc.
- tc := tc
+ tc := testCases[tci]
testName := fmt.Sprintf("%s_%s", tc.Suite, tc.Name)
tests = append(tests, testing.InternalTest{
Name: testName,