From 9dc5de51a2c9c4785f1b96232221919ffa44d8ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 5 Nov 2015 13:29:50 +0200 Subject: [PATCH] tests: fix data race in bad-block-report disabling during tests --- tests/init.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/init.go b/tests/init.go index 3f8b8c6844..a869704999 100644 --- a/tests/init.go +++ b/tests/init.go @@ -56,13 +56,16 @@ var ( VmSkipTests = []string{} ) +// Disable reporting bad blocks for the tests +func init() { + core.DisableBadBlockReporting = true +} + func readJson(reader io.Reader, value interface{}) error { data, err := ioutil.ReadAll(reader) if err != nil { return fmt.Errorf("Error reading JSON file", err.Error()) } - - core.DisableBadBlockReporting = true if err = json.Unmarshal(data, &value); err != nil { if syntaxerr, ok := err.(*json.SyntaxError); ok { line := findLine(data, syntaxerr.Offset)