Merge pull request #1968 from karalabe/fix-json-tests-datarace

tests: fix data race in bad-block-report disabling during tests
release/1.3.2^2
Felix Lange 9 years ago
commit ca4f6d0fdd
  1. 7
      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)

Loading…
Cancel
Save