File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -248,6 +248,21 @@ func TestCloseConnectionWhenServerPrefaceNotReceived(t *testing.T) {
248
248
t .Fatalf ("Error while dialing. Err: %v" , err )
249
249
}
250
250
<- done
251
+ // TODO: The code from BEGIN to END should be delete once issue
252
+ // https://github.com/grpc/grpc-go/issues/1750 is fixed.
253
+ // BEGIN
254
+ // Set underlying addrConns state to Shutdown so that no reconnect
255
+ // attempts take place and thereby resetting minConnectTimeout is
256
+ // race free.
257
+ client .mu .Lock ()
258
+ addrConns := client .conns
259
+ client .mu .Unlock ()
260
+ for ac := range addrConns {
261
+ ac .mu .Lock ()
262
+ ac .state = connectivity .Shutdown
263
+ ac .mu .Unlock ()
264
+ }
265
+ // END
251
266
client .Close ()
252
267
close (clientDone )
253
268
}
You can’t perform that action at this time.
0 commit comments