From b5c5dd778688b4ce3e51da11f7bd9e14d034b764 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 21 May 2020 15:35:03 +0200 Subject: prog: speed up TestPrioDeterminism Make it faster + disable in race mode (still too slow). --- prog/prio_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'prog/prio_test.go') diff --git a/prog/prio_test.go b/prog/prio_test.go index dede67e5f..a09bd5438 100644 --- a/prog/prio_test.go +++ b/prog/prio_test.go @@ -7,8 +7,6 @@ import ( "math/rand" "reflect" "testing" - - "github.com/google/go-cmp/cmp" ) func TestNormalizePrio(t *testing.T) { @@ -71,6 +69,9 @@ func TestStaticPriorities(t *testing.T) { } func TestPrioDeterminism(t *testing.T) { + if raceEnabled { + t.Skip("skipping in race mode, too slow") + } target, rs, iters := initTest(t) ct := target.DefaultChoiceTable() var corpus []*Prog @@ -79,8 +80,8 @@ func TestPrioDeterminism(t *testing.T) { } ct0 := target.BuildChoiceTable(corpus, nil) ct1 := target.BuildChoiceTable(corpus, nil) - if diff := cmp.Diff(ct0.runs, ct1.runs); diff != "" { - t.Fatal(diff) + if !reflect.DeepEqual(ct0.runs, ct1.runs) { + t.Fatal("non-deterministic ChoiceTable") } for i := 0; i < iters; i++ { seed := rs.Int63() -- cgit mrf-deployment