p2p: add log as part of server structs in tests

This commit is contained in:
Anton Evangelatov 2017-11-15 15:58:48 +01:00
parent 4c006eb373
commit 21210b98b1

View file

@ -27,6 +27,7 @@ import (
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto/sha3"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p/discover"
)
@ -206,6 +207,7 @@ func TestServerTaskScheduling(t *testing.T) {
quit: make(chan struct{}),
ntab: fakeTable{},
running: true,
log: log.New(),
}
srv.loopWG.Add(1)
go func() {
@ -246,7 +248,12 @@ func TestServerManyTasks(t *testing.T) {
}
var (
srv = &Server{quit: make(chan struct{}), ntab: fakeTable{}, running: true}
srv = &Server{
quit: make(chan struct{}),
ntab: fakeTable{},
running: true,
log: log.New(),
}
done = make(chan *testTask)
start, end = 0, 0
)
@ -428,6 +435,7 @@ func TestServerSetupConn(t *testing.T) {
Protocols: []Protocol{discard},
},
newTransport: func(fd net.Conn) transport { return test.tt },
log: log.New(),
}
if !test.dontstart {
if err := srv.Start(); err != nil {