Skip to content

Commit

Permalink
Nits
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed Oct 23, 2024
1 parent da2e83d commit 581571b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions p2p/host/basic/basic_host_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,8 @@ func TestHostTimeoutNewStream(t *testing.T) {
assert.NoError(t, err)

msgLen, varintN := binary.Uvarint(buf[:n])
proto := buf[varintN : varintN+int(msgLen)]
buf = buf[varintN:]
proto := buf[:int(msgLen)]
if string(proto) == "/ipfs/id/1.0.0\n" {
// Signal we don't support identify
na := []byte("na\n")
Expand All @@ -977,15 +978,16 @@ func TestHostTimeoutNewStream(t *testing.T) {
} else {
// Stall
time.Sleep(5 * time.Second)
t.Log("Resetting")
}
t.Log("Resetting")
s.Reset()
})

h1.Connect(context.Background(), peer.AddrInfo{
err = h1.Connect(context.Background(), peer.AddrInfo{
ID: h2.LocalPeer(),
Addrs: h2.ListenAddresses(),
})
require.NoError(t, err)

// No context passed in, fallback to negtimeout
h1.negtimeout = time.Second
Expand Down

0 comments on commit 581571b

Please sign in to comment.