From 06a2b89fc3e93a6c381a5d9df229766f706b58d0 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 2 Jan 2019 11:55:53 +0100 Subject: prog, pkg/{csource,ifuzz,ipc,repro}: make tests deterministic on travis Don't use random seed on travis as it produces flaky coverage reports, and probably generally better for CI setting. --- pkg/ifuzz/ifuzz_test.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pkg/ifuzz') diff --git a/pkg/ifuzz/ifuzz_test.go b/pkg/ifuzz/ifuzz_test.go index bc5408a6f..3758f08d2 100644 --- a/pkg/ifuzz/ifuzz_test.go +++ b/pkg/ifuzz/ifuzz_test.go @@ -6,6 +6,7 @@ package ifuzz_test import ( "encoding/hex" "math/rand" + "os" "testing" "time" @@ -36,6 +37,9 @@ func TestMode(t *testing.T) { func TestDecode(t *testing.T) { seed := int64(time.Now().UnixNano()) + if os.Getenv("TRAVIS") != "" { + seed = 0 // required for deterministic coverage reports + } t.Logf("seed=%v", seed) r := rand.New(rand.NewSource(seed)) -- cgit mrf-deployment