File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -131,23 +131,28 @@ 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 {}{}
145
149
}()
146
150
151
+ testutil .RequireRecvCtx (ctx , t , listening )
147
152
nc , err := w2 .DialContextTCP (ctx , netip .AddrPortFrom (w1IP , 35565 ))
148
153
require .NoError (t , err )
149
154
_ = nc .Close ()
150
- <- conn
155
+ testutil . RequireRecvCtx ( ctx , t , done )
151
156
152
157
nodes := make (chan * tailnet.Node , 1 )
153
158
w2 .SetNodeCallback (func (node * tailnet.Node ) {
You can’t perform that action at this time.
0 commit comments