Merge pull request #900 from nspcc-dev/fix/861
core,network: shutdown services in tests properly
This commit is contained in:
commit
473ab861c7
2 changed files with 11 additions and 1 deletions
|
@ -203,6 +203,7 @@ func TestCreateBasicChain(t *testing.T) {
|
||||||
var neoAmount = util.Fixed8FromInt64(99999000)
|
var neoAmount = util.Fixed8FromInt64(99999000)
|
||||||
var neoRemainder = util.Fixed8FromInt64(100000000) - neoAmount
|
var neoRemainder = util.Fixed8FromInt64(100000000) - neoAmount
|
||||||
bc := newTestChain(t)
|
bc := newTestChain(t)
|
||||||
|
defer bc.Close()
|
||||||
|
|
||||||
// Move almost all NEO to one simple account.
|
// Move almost all NEO to one simple account.
|
||||||
txMoveNeo := transaction.NewContractTX()
|
txMoveNeo := transaction.NewContractTX()
|
||||||
|
|
|
@ -59,7 +59,16 @@ func TestServerNotSendsVerack(t *testing.T) {
|
||||||
p2 = newLocalPeer(t, s)
|
p2 = newLocalPeer(t, s)
|
||||||
)
|
)
|
||||||
s.id = 1
|
s.id = 1
|
||||||
go s.run()
|
finished := make(chan struct{})
|
||||||
|
go func() {
|
||||||
|
s.run()
|
||||||
|
close(finished)
|
||||||
|
}()
|
||||||
|
defer func() {
|
||||||
|
// close via quit as server was started via `run()`, not `Start()`
|
||||||
|
close(s.quit)
|
||||||
|
<-finished
|
||||||
|
}()
|
||||||
|
|
||||||
na, _ := net.ResolveTCPAddr("tcp", "0.0.0.0:3000")
|
na, _ := net.ResolveTCPAddr("tcp", "0.0.0.0:3000")
|
||||||
p.netaddr = *na
|
p.netaddr = *na
|
||||||
|
|
Loading…
Reference in a new issue