[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [pluggable-transports/snowflake] 05/07: Fix loop termination in TestQueuePacketConnWriteToKCP.



This is an automated email from the git hooks/post-receive script.

meskio pushed a commit to branch main
in repository pluggable-transports/snowflake.

commit 97c930013b2e5fa4cf81af636e94b38ad0632033
Author: David Fifield <david@xxxxxxxxxxxxxxx>
AuthorDate: Tue Apr 4 19:09:47 2023 -0600

    Fix loop termination in TestQueuePacketConnWriteToKCP.
    
    The noise-generating goroutine was meant to stop when the parent
    function returned and closed the `done` channel. The `break` in the loop
    was wrongly exiting only from the `select`, not from the `for`.
    
    This was the cause of banchmark anomalies in
    https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40260#note_2885832.
    The noise-generating loop from the test was continuing to run while the
    benchmarks were running.
---
 common/turbotunnel/queuepacketconn_test.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/common/turbotunnel/queuepacketconn_test.go b/common/turbotunnel/queuepacketconn_test.go
index 2bb4eeb..37f46bc 100644
--- a/common/turbotunnel/queuepacketconn_test.go
+++ b/common/turbotunnel/queuepacketconn_test.go
@@ -99,10 +99,11 @@ func TestQueuePacketConnWriteToKCP(t *testing.T) {
 		defer readyClose.Do(func() { close(ready) })
 		pconn := DiscardPacketConn{}
 		defer pconn.Close()
+	loop:
 		for {
 			select {
 			case <-done:
-				break
+				break loop
 			default:
 			}
 			// Create a new UDPSession, send once, then discard the

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits