mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Close temporary UDPSession in TestQueuePacketConnWriteToKCP.
With these not being closed, they were continuing to consume resources after the return of the test function, which was affecting the later BenchmarkSendQueue. Before: ``` snowflake/common/turbotunnel$ go test -bench BenchmarkSendQueue -v === RUN TestQueueIncomingOversize --- PASS: TestQueueIncomingOversize (0.00s) === RUN TestWriteToOversize --- PASS: TestWriteToOversize (0.00s) === RUN TestRestoreMTU --- PASS: TestRestoreMTU (0.00s) === RUN TestRestoreCap --- PASS: TestRestoreCap (0.00s) === RUN TestQueuePacketConnWriteToKCP --- PASS: TestQueuePacketConnWriteToKCP (1.01s) goos: linux goarch: amd64 pkg: gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/turbotunnel cpu: Intel(R) Core(TM) i5 CPU 680 @ 3.60GHz BenchmarkSendQueue BenchmarkSendQueue-4 8519708 136.0 ns/op PASS ok gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/turbotunnel 3.481s ``` After: ``` snowflake/common/turbotunnel$ go test -bench BenchmarkSendQueue -v === RUN TestQueueIncomingOversize --- PASS: TestQueueIncomingOversize (0.00s) === RUN TestWriteToOversize --- PASS: TestWriteToOversize (0.00s) === RUN TestRestoreMTU --- PASS: TestRestoreMTU (0.00s) === RUN TestRestoreCap --- PASS: TestRestoreCap (0.00s) === RUN TestQueuePacketConnWriteToKCP --- PASS: TestQueuePacketConnWriteToKCP (1.02s) goos: linux goarch: amd64 pkg: gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/turbotunnel cpu: Intel(R) Core(TM) i5 CPU 680 @ 3.60GHz BenchmarkSendQueue BenchmarkSendQueue-4 11620237 105.7 ns/op PASS ok gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/turbotunnel 3.244s ```
This commit is contained in:
parent
80980a3afb
commit
58c3121c6b
1 changed files with 1 additions and 0 deletions
|
@ -182,6 +182,7 @@ func TestQueuePacketConnWriteToKCP(t *testing.T) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
conn.Close()
|
||||||
// Signal the main test to start once we have done one
|
// Signal the main test to start once we have done one
|
||||||
// iterator of this noisy loop.
|
// iterator of this noisy loop.
|
||||||
readyClose.Do(func() { close(ready) })
|
readyClose.Do(func() { close(ready) })
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue