Commit 784ff9c5 authored by Steven Allen's avatar Steven Allen
Browse files

fix closing of mock streams in test

parent f56473fb
...@@ -114,7 +114,7 @@ func TestNotifications(t *testing.T) { ...@@ -114,7 +114,7 @@ func TestNotifications(t *testing.T) {
for _, s := range nets { for _, s := range nets {
s.SetStreamHandler(func(s inet.Stream) { s.SetStreamHandler(func(s inet.Stream) {
s.Close() inet.FullClose(s)
}) })
} }
...@@ -131,7 +131,7 @@ func TestNotifications(t *testing.T) { ...@@ -131,7 +131,7 @@ func TestNotifications(t *testing.T) {
for _, s := range nets { for _, s := range nets {
s.SetStreamHandler(func(s inet.Stream) { s.SetStreamHandler(func(s inet.Stream) {
streams <- s streams <- s
s.Close() inet.FullClose(s)
}) })
} }
...@@ -146,7 +146,7 @@ func TestNotifications(t *testing.T) { ...@@ -146,7 +146,7 @@ func TestNotifications(t *testing.T) {
} else { } else {
t.Logf("%s %s <--%p--> %s %s", c.LocalPeer(), c.LocalMultiaddr(), st1, c.RemotePeer(), c.RemoteMultiaddr()) t.Logf("%s %s <--%p--> %s %s", c.LocalPeer(), c.LocalMultiaddr(), st1, c.RemotePeer(), c.RemoteMultiaddr())
// st1.Write([]byte("hello")) // st1.Write([]byte("hello"))
st1.Close() go inet.FullClose(st1)
st2 := <-streams st2 := <-streams
t.Logf("%s %s <--%p--> %s %s", c2.LocalPeer(), c2.LocalMultiaddr(), st2, c2.RemotePeer(), c2.RemoteMultiaddr()) t.Logf("%s %s <--%p--> %s %s", c2.LocalPeer(), c2.LocalMultiaddr(), st2, c2.RemotePeer(), c2.RemoteMultiaddr())
testOCStream(notifiees[i], st1) testOCStream(notifiees[i], st1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment