Skip to content

Commit

Permalink
Merge pull request #61 from marten-seemann/fix-windows-tests
Browse files Browse the repository at this point in the history
fix the lazy stress read test on Windows
  • Loading branch information
Stebalien authored Mar 30, 2021
2 parents 7c6e444 + d12fb32 commit 90e4d4d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions multistream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func TestProtocolNegotiationLazy(t *testing.T) {
}

func TestNegLazyStressRead(t *testing.T) {
const count = 100
const count = 75

mux := NewMultistreamMuxer()
mux.AddHandler("/a", nil)
Expand All @@ -159,7 +159,9 @@ func TestNegLazyStressRead(t *testing.T) {

message := []byte("this is the message")
listener := make(chan io.ReadWriteCloser)
done := make(chan struct{})
go func() {
defer close(done)
for rwc := range listener {
m, selected, _, err := mux.NegotiateLazy(rwc)
if err != nil {
Expand All @@ -185,7 +187,6 @@ func TestNegLazyStressRead(t *testing.T) {
rwc.Close()
}
}()
defer func() { close(listener) }()

for i := 0; i < count; i++ {
a, b := newPipe(t)
Expand All @@ -198,8 +199,10 @@ func TestNegLazyStressRead(t *testing.T) {
t.Fatal(err)
}

b.Close()
defer b.Close()
}
close(listener)
<-done
}

func TestNegLazyStressWrite(t *testing.T) {
Expand Down

0 comments on commit 90e4d4d

Please sign in to comment.