neo-go/pkg/consensus
Roman Khimov 760b39e324 consensus: close chain in tests
Avoid test failures like this one:

=== RUN   TestService_OnPayload
==================
WARNING: DATA RACE
Read at 0x00c00015a843 by goroutine 112:
  testing.(*common).logDepth()
      /usr/local/go/src/testing/testing.go:665 +0xa1
  testing.(*common).Logf()
      /usr/local/go/src/testing/testing.go:658 +0x8f
  testing.(*T).Logf()
      <autogenerated>:1 +0x75
  go.uber.org/zap/zaptest.testingWriter.Write()
      /go/pkg/mod/go.uber.org/zap@v1.10.0/zaptest/logger.go:130 +0x11f
  go.uber.org/zap/zaptest.(*testingWriter).Write()
      <autogenerated>:1 +0xa9
  go.uber.org/zap/zapcore.(*ioCore).Write()
      /go/pkg/mod/go.uber.org/zap@v1.10.0/zapcore/core.go:90 +0x1c3
  go.uber.org/zap/zapcore.(*CheckedEntry).Write()
      /go/pkg/mod/go.uber.org/zap@v1.10.0/zapcore/entry.go:215 +0x1e7
  go.uber.org/zap.(*Logger).Info()
      /go/pkg/mod/go.uber.org/zap@v1.10.0/logger.go:187 +0x95
  github.com/CityOfZion/neo-go/pkg/core.(*Blockchain).persist()
      /go/src/github.com/CityOfZion/neo-go/pkg/core/blockchain.go:720 +0x6bb
  github.com/CityOfZion/neo-go/pkg/core.(*Blockchain).Run.func2()
      /go/src/github.com/CityOfZion/neo-go/pkg/core/blockchain.go:228 +0x53

Previous write at 0x00c00015a843 by goroutine 98:
  testing.tRunner.func1()
      /usr/local/go/src/testing/testing.go:900 +0x353
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:913 +0x1bb

Goroutine 112 (running) created at:
  github.com/CityOfZion/neo-go/pkg/core.(*Blockchain).Run()
      /go/src/github.com/CityOfZion/neo-go/pkg/core/blockchain.go:227 +0x264

Goroutine 98 (finished) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:960 +0x651
  testing.runTests.func1()
      /usr/local/go/src/testing/testing.go:1202 +0xa6
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:909 +0x199
  testing.runTests()
      /usr/local/go/src/testing/testing.go:1200 +0x521
  testing.(*M).Run()
      /usr/local/go/src/testing/testing.go:1117 +0x2ff
  main.main()
      _testmain.go:162 +0x337
==================
--- FAIL: TestService_OnPayload (4.11s)
2020-01-20 19:40:52 +03:00
..
testdata consensus: use wallet in service 2020-01-17 17:25:51 +03:00
block.go block: rename BlockBase to Base 2020-01-16 10:16:24 +03:00
block_test.go network: plug in dBFT library 2019-11-27 10:57:22 +03:00
cache.go network: plug in dBFT library 2019-11-27 10:57:22 +03:00
cache_test.go network: plug in dBFT library 2019-11-27 10:57:22 +03:00
change_view.go io: add type-specific read/write methods 2019-12-12 20:19:50 +03:00
change_view_test.go network: plug in dBFT library 2019-11-27 10:57:22 +03:00
commit.go io: implement ReadBytes() 2019-12-09 15:00:15 +03:00
commit_test.go network: plug in dBFT library 2019-11-27 10:57:22 +03:00
consensus.go Merge pull request #601 from nspcc-dev/refactoring/core 2020-01-20 16:19:20 +03:00
consensus_test.go consensus: close chain in tests 2020-01-20 19:40:52 +03:00
crypto.go keys: don't return error from PrivateKey.Sign 2020-01-17 17:00:30 +03:00
crypto_test.go network: plug in dBFT library 2019-11-27 10:57:22 +03:00
payload.go consensus: verify payloads correctly 2019-12-26 10:49:56 +03:00
payload_test.go consensus: verify payloads correctly 2019-12-26 10:49:56 +03:00
prepare_request.go io: add type-specific read/write methods 2019-12-12 20:19:50 +03:00
prepare_request_test.go network: plug in dBFT library 2019-11-27 10:57:22 +03:00
prepare_response.go io: implement ReadBytes() 2019-12-09 15:00:15 +03:00
prepare_response_test.go network: plug in dBFT library 2019-11-27 10:57:22 +03:00
recovery_message.go io: rename Read/WriteBytes to Read/WriteB 2019-12-12 20:19:50 +03:00
recovery_message_test.go consensus: verify payloads correctly 2019-12-26 10:49:56 +03:00
recovery_request.go io: add type-specific read/write methods 2019-12-12 20:19:50 +03:00
recovery_request_test.go network: plug in dBFT library 2019-11-27 10:57:22 +03:00