replace closed sessions in the packet handler map

This commit is contained in:
Marten Seemann 2019-11-02 20:32:59 +07:00
parent 46c46689c5
commit c7334e3e66
9 changed files with 179 additions and 160 deletions

View file

@ -1,9 +1,6 @@
package quic
import (
"bytes"
"runtime/pprof"
"strings"
"sync"
"github.com/golang/mock/gomock"
@ -27,21 +24,6 @@ var _ = BeforeEach(func() {
connMuxerOnce = *new(sync.Once)
})
func areSessionsRunning() bool {
var b bytes.Buffer
pprof.Lookup("goroutine").WriteTo(&b, 1)
return strings.Contains(b.String(), "quic-go.(*session).run")
}
func areClosedSessionsRunning() bool {
var b bytes.Buffer
pprof.Lookup("goroutine").WriteTo(&b, 1)
return strings.Contains(b.String(), "quic-go.(*closedLocalSession).run") ||
strings.Contains(b.String(), "quic-go.(*closedRemoteSession).run")
}
var _ = AfterEach(func() {
mockCtrl.Finish()
Eventually(areSessionsRunning).Should(BeFalse())
Eventually(areClosedSessionsRunning).Should(BeFalse())
})