implement the Transport

This commit is contained in:
Marten Seemann 2023-04-06 18:02:51 +08:00
parent ae5a8bd35c
commit 8189e75be6
31 changed files with 1309 additions and 1250 deletions

View file

@ -1,8 +1,11 @@
package quic
import (
"bytes"
"io"
"log"
"runtime/pprof"
"strings"
"sync"
"testing"
@ -29,6 +32,20 @@ var _ = BeforeSuite(func() {
log.SetOutput(io.Discard)
})
func areServersRunning() bool {
var b bytes.Buffer
pprof.Lookup("goroutine").WriteTo(&b, 1)
return strings.Contains(b.String(), "quic-go.(*baseServer).run")
}
func areTransportsRunning() bool {
var b bytes.Buffer
pprof.Lookup("goroutine").WriteTo(&b, 1)
return strings.Contains(b.String(), "quic-go.(*Transport).listen")
}
var _ = AfterEach(func() {
mockCtrl.Finish()
Eventually(areServersRunning).Should(BeFalse())
Eventually(areTransportsRunning()).Should(BeFalse())
})