File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -131,23 +131,29 @@ func TestTailnet(t *testing.T) {
131
131
stitch (t , w2 , w1 )
132
132
stitch (t , w1 , w2 )
133
133
require .True (t , w2 .AwaitReachable (ctx , w1IP ))
134
- conn := make (chan struct {}, 1 )
134
+ done := make (chan struct {})
135
+ listening := make (chan struct {})
135
136
go func () {
137
+ defer close (done )
136
138
listener , err := w1 .Listen ("tcp" , ":35565" )
137
- assert .NoError (t , err )
139
+ if ! assert .NoError (t , err ) {
140
+ return
141
+ }
138
142
defer listener .Close ()
143
+ close (listening )
139
144
nc , err := listener .Accept ()
140
145
if ! assert .NoError (t , err ) {
141
146
return
142
147
}
143
148
_ = nc .Close ()
144
- conn <- struct {}{}
149
+
145
150
}()
146
151
152
+ testutil .RequireRecvCtx (ctx , t , listening )
147
153
nc , err := w2 .DialContextTCP (ctx , netip .AddrPortFrom (w1IP , 35565 ))
148
154
require .NoError (t , err )
149
155
_ = nc .Close ()
150
- <- conn
156
+ testutil . RequireRecvCtx ( ctx , t , done )
151
157
152
158
nodes := make (chan * tailnet.Node , 1 )
153
159
w2 .SetNodeCallback (func (node * tailnet.Node ) {
You can’t perform that action at this time.
0 commit comments