Skip to content

Commit 206fe25

Browse files
committed
p2p: remove testlog
1 parent 7fa2607 commit 206fe25

3 files changed

Lines changed: 0 additions & 51 deletions

File tree

‎p2p/peer_test.go‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ func testPeer(protos []Protocol) (func(), *conn, *Peer, <-chan DiscReason) {
5050
}
5151

5252
func TestPeerProtoReadMsg(t *testing.T) {
53-
defer testlog(t).detach()
54-
5553
done := make(chan struct{})
5654
proto := Protocol{
5755
Name: "a",
@@ -88,8 +86,6 @@ func TestPeerProtoReadMsg(t *testing.T) {
8886
}
8987

9088
func TestPeerProtoEncodeMsg(t *testing.T) {
91-
defer testlog(t).detach()
92-
9389
proto := Protocol{
9490
Name: "a",
9591
Length: 2,
@@ -112,8 +108,6 @@ func TestPeerProtoEncodeMsg(t *testing.T) {
112108
}
113109

114110
func TestPeerWriteForBroadcast(t *testing.T) {
115-
defer testlog(t).detach()
116-
117111
closer, rw, peer, peerErr := testPeer([]Protocol{discard})
118112
defer closer()
119113

@@ -152,8 +146,6 @@ func TestPeerWriteForBroadcast(t *testing.T) {
152146
}
153147

154148
func TestPeerPing(t *testing.T) {
155-
defer testlog(t).detach()
156-
157149
closer, rw, _, _ := testPeer(nil)
158150
defer closer()
159151
if err := SendItems(rw, pingMsg); err != nil {
@@ -165,8 +157,6 @@ func TestPeerPing(t *testing.T) {
165157
}
166158

167159
func TestPeerDisconnect(t *testing.T) {
168-
defer testlog(t).detach()
169-
170160
closer, rw, _, disc := testPeer(nil)
171161
defer closer()
172162
if err := SendItems(rw, discMsg, DiscQuitting); err != nil {
@@ -185,7 +175,6 @@ func TestPeerDisconnect(t *testing.T) {
185175
// This test is supposed to verify that Peer can reliably handle
186176
// multiple causes of disconnection occurring at the same time.
187177
func TestPeerDisconnectRace(t *testing.T) {
188-
defer testlog(t).detach()
189178
maybe := func() bool { return rand.Intn(1) == 1 }
190179

191180
for i := 0; i < 1000; i++ {

‎p2p/server_test.go‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ func startTestServer(t *testing.T, pf newPeerHook) *Server {
4646
}
4747

4848
func TestServerListen(t *testing.T) {
49-
defer testlog(t).detach()
50-
5149
// start the test server
5250
connected := make(chan *Peer)
5351
srv := startTestServer(t, func(p *Peer) {
@@ -78,8 +76,6 @@ func TestServerListen(t *testing.T) {
7876
}
7977

8078
func TestServerDial(t *testing.T) {
81-
defer testlog(t).detach()
82-
8379
// run a one-shot TCP server to handle the connection.
8480
listener, err := net.Listen("tcp", "127.0.0.1:0")
8581
if err != nil {
@@ -126,8 +122,6 @@ func TestServerDial(t *testing.T) {
126122
}
127123

128124
func TestServerBroadcast(t *testing.T) {
129-
defer testlog(t).detach()
130-
131125
var connected sync.WaitGroup
132126
srv := startTestServer(t, func(p *Peer) {
133127
p.running = matchProtocols([]Protocol{discard}, []Cap{discard.cap()}, p.rw)
@@ -172,8 +166,6 @@ func TestServerBroadcast(t *testing.T) {
172166
//
173167
// It also serves as a light-weight integration test.
174168
func TestServerDisconnectAtCap(t *testing.T) {
175-
defer testlog(t).detach()
176-
177169
started := make(chan *Peer)
178170
srv := &Server{
179171
ListenAddr: "127.0.0.1:0",
@@ -224,8 +216,6 @@ func TestServerDisconnectAtCap(t *testing.T) {
224216

225217
// Tests that static peers are (re)connected, and done so even above max peers.
226218
func TestServerStaticPeers(t *testing.T) {
227-
defer testlog(t).detach()
228-
229219
// Create a test server with limited connection slots
230220
started := make(chan *Peer)
231221
server := &Server{
@@ -312,7 +302,6 @@ func TestServerStaticPeers(t *testing.T) {
312302

313303
// Tests that trusted peers and can connect above max peer caps.
314304
func TestServerTrustedPeers(t *testing.T) {
315-
defer testlog(t).detach()
316305

317306
// Create a trusted peer to accept connections from
318307
key := newkey()
@@ -374,8 +363,6 @@ func TestServerTrustedPeers(t *testing.T) {
374363

375364
// Tests that a failed dial will temporarily throttle a peer.
376365
func TestServerMaxPendingDials(t *testing.T) {
377-
defer testlog(t).detach()
378-
379366
// Start a simple test server
380367
server := &Server{
381368
ListenAddr: "127.0.0.1:0",
@@ -443,8 +430,6 @@ func TestServerMaxPendingDials(t *testing.T) {
443430
}
444431

445432
func TestServerMaxPendingAccepts(t *testing.T) {
446-
defer testlog(t).detach()
447-
448433
// Start a test server and a peer sink for synchronization
449434
started := make(chan *Peer)
450435
server := &Server{

‎p2p/testlog_test.go‎

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)