mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-27 03:58:06 +00:00
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 neoRemainder = util.Fixed8FromInt64(100000000) - neoAmount
|
||||
bc := newTestChain(t)
|
||||
defer bc.Close()
|
||||
|
||||
// Move almost all NEO to one simple account.
|
||||
txMoveNeo := transaction.NewContractTX()
|
||||
|
|
|
@ -59,7 +59,16 @@ func TestServerNotSendsVerack(t *testing.T) {
|
|||
p2 = newLocalPeer(t, s)
|
||||
)
|
||||
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")
|
||||
p.netaddr = *na
|
||||
|
|
Loading…
Reference in a new issue