Close subscription in integration test
* This was causing issues in future tests, since the subscription was causing blocks and transactions to be added to the DB
This commit is contained in:
@@ -22,11 +22,21 @@ func RunTimePath() string {
|
||||
|
||||
var _ = Describe("Reading from the Geth blockchain", func() {
|
||||
|
||||
It("reads two blocks", func(done Done) {
|
||||
observer := fakes.NewFakeBlockchainObserverTwo()
|
||||
var listener blockchain_listener.BlockchainListener
|
||||
var observer *fakes.BlockchainObserver
|
||||
|
||||
BeforeEach(func() {
|
||||
observer = fakes.NewFakeBlockchainObserverTwo()
|
||||
blockchain := geth.NewGethBlockchain(RunTimePath() + "/test_data_dir/geth.ipc")
|
||||
observers := []core.BlockchainObserver{observer}
|
||||
listener := blockchain_listener.NewBlockchainListener(blockchain, observers)
|
||||
listener = blockchain_listener.NewBlockchainListener(blockchain, observers)
|
||||
})
|
||||
|
||||
AfterEach(func() {
|
||||
listener.Stop()
|
||||
})
|
||||
|
||||
It("reads two blocks", func(done Done) {
|
||||
go listener.Start()
|
||||
|
||||
<-observer.WasNotified
|
||||
|
||||
Reference in New Issue
Block a user