Skip to content

Commit

Permalink
tests: fix data race in bad-block-report disabling during tests
Browse files Browse the repository at this point in the history
  • Loading branch information
karalabe committed Nov 5, 2015
1 parent e3f36d9 commit 9dc5de5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9dc5de5

Please sign in to comment.