diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-05-21 15:35:03 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-05-21 16:18:44 +0200 |
| commit | b5c5dd778688b4ce3e51da11f7bd9e14d034b764 (patch) | |
| tree | cc5cd3337d8b3d766af4ff2266382410e0c5e17d /prog/prio_test.go | |
| parent | 4053862c2605da2c3cfdf9f866f8588cf5716ebd (diff) | |
prog: speed up TestPrioDeterminism
Make it faster + disable in race mode (still too slow).
Diffstat (limited to 'prog/prio_test.go')
| -rw-r--r-- | prog/prio_test.go | 9 |
1 files changed, 5 insertions, 4 deletions
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() |
