Commit 0698e272 authored by Steven Allen's avatar Steven Allen

feat: update to go-libp2p-core 0.7.0

Updates stream interfaces.
parent 99f31e58
This diff is collapsed.
......@@ -320,12 +320,13 @@ func tcpPipe(t *testing.T) (net.Conn, net.Conn) {
func SubtestStreamOpenStress(t *testing.T, tr mux.Multiplexer) {
wg := new(sync.WaitGroup)
defer wg.Wait()
a, b := tcpPipe(t)
defer a.Close()
defer b.Close()
defer wg.Wait()
wg.Add(1)
count := 10000
workers := 5
......@@ -343,7 +344,17 @@ func SubtestStreamOpenStress(t *testing.T, tr mux.Multiplexer) {
t.Error(err)
return
}
s.Close()
err = s.CloseWrite()
if err != nil {
t.Error(err)
}
n, err := s.Read([]byte{0})
if n != 0 {
t.Error("expected to read no bytes")
}
if err != io.EOF {
t.Errorf("expected an EOF, got %s", err)
}
}
}
......@@ -364,7 +375,7 @@ func SubtestStreamOpenStress(t *testing.T, tr mux.Multiplexer) {
recv := make(chan struct{}, count*workers)
go func() {
defer wg.Done()
for {
for i := 0; i < count*workers; i++ {
str, err := muxb.AcceptStream()
if err != nil {
break
......
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