From 0fcd5fd3ddb45f5571658c4fce1589427a5bf090 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 25 May 2017 16:37:05 +0200 Subject: all: speed up tests Mark tests as parallel where makes sense. Speed up sys.TransitivelyEnabledCalls. Execution time is now: ok github.com/google/syzkaller/config 0.172s ok github.com/google/syzkaller/cover 0.060s ok github.com/google/syzkaller/csource 3.081s ok github.com/google/syzkaller/db 0.395s ok github.com/google/syzkaller/executor 0.060s ok github.com/google/syzkaller/fileutil 0.106s ok github.com/google/syzkaller/host 1.530s ok github.com/google/syzkaller/ifuzz 0.491s ok github.com/google/syzkaller/ipc 1.374s ok github.com/google/syzkaller/log 0.014s ok github.com/google/syzkaller/prog 2.604s ok github.com/google/syzkaller/report 0.045s ok github.com/google/syzkaller/symbolizer 0.062s ok github.com/google/syzkaller/sys 0.365s ok github.com/google/syzkaller/syz-dash 0.014s ok github.com/google/syzkaller/syz-hub/state 0.427s ok github.com/google/syzkaller/vm 0.052s However, main time is still taken by rebuilding sys package. Fixes #182 --- csource/csource_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'csource') diff --git a/csource/csource_test.go b/csource/csource_test.go index b5832ad8c..78998a32f 100644 --- a/csource/csource_test.go +++ b/csource/csource_test.go @@ -15,6 +15,7 @@ import ( ) func initTest(t *testing.T) (rand.Source, int) { + t.Parallel() iters := 10 if testing.Short() { iters = 1 @@ -70,11 +71,12 @@ func TestSyz(t *testing.T) { } func Test(t *testing.T) { - rs, iters := initTest(t) + rs, _ := initTest(t) syzProg := prog.GenerateAllSyzProg(rs) t.Logf("syz program:\n%s\n", syzProg.Serialize()) for i, opts := range allOptionsPermutations() { t.Run(fmt.Sprintf("%v", i), func(t *testing.T) { + rs, iters := initTest(t) t.Logf("opts: %+v", opts) for i := 0; i < iters; i++ { p := prog.Generate(rs, 10, nil) -- cgit mrf-deployment