Skip to content

Commit

Permalink
fix incorrect reuse of UDP connection in handshake benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed May 5, 2024
1 parent b4210f8 commit 3d7e516
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion integrationtests/self/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ func BenchmarkHandshake(b *testing.B) {
if err != nil {
b.Fatal(err)
}
defer conn.Close()
tr := &quic.Transport{Conn: conn}
defer tr.Close()

b.ResetTimer()
for i := 0; i < b.N; i++ {
c, err := quic.Dial(context.Background(), conn, ln.Addr(), tlsClientConfig, nil)
c, err := tr.Dial(context.Background(), ln.Addr(), tlsClientConfig, nil)
if err != nil {
b.Fatal(err)
}
Expand Down

0 comments on commit 3d7e516

Please sign in to comment.