Skip to content

Commit b5a7a36

Browse files
committed
Document why we have a loop retrying
1 parent cd6176d commit b5a7a36

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/liveshare/port_forwarder_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ func TestPortForwarderStart(t *testing.T) {
8282

8383
go func() {
8484
var conn net.Conn
85+
86+
// We retry DialTimeout in a loop to deal with a race in PortForwarder startup.
8587
for tries := 0; conn == nil && tries < 2; tries++ {
8688
conn, err = net.DialTimeout("tcp", ":8000", 2*time.Second)
8789
if conn == nil {

0 commit comments

Comments
 (0)