diff options
author | Felix Lange <fjl@twurst.com> | 2015-11-05 19:59:07 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-11-05 19:59:07 +0800 |
commit | ca4f6d0fdd861046c0d47e2fdd7e63c20efae3d9 (patch) | |
tree | 6d2b87f2778948e35b566ae5055c42695a4a7f56 /tests/init.go | |
parent | e3f36d97288636f222f451b26c7c89e334ce4869 (diff) | |
parent | 9dc5de51a2c9c4785f1b96232221919ffa44d8ef (diff) | |
download | dexon-ca4f6d0fdd861046c0d47e2fdd7e63c20efae3d9.tar.gz dexon-ca4f6d0fdd861046c0d47e2fdd7e63c20efae3d9.tar.zst dexon-ca4f6d0fdd861046c0d47e2fdd7e63c20efae3d9.zip |
Merge pull request #1968 from karalabe/fix-json-tests-datarace
tests: fix data race in bad-block-report disabling during tests
Diffstat (limited to 'tests/init.go')
-rw-r--r-- | tests/init.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/init.go b/tests/init.go index 3f8b8c684..a86970499 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) |