internal/resolver: fix possible goroutine leak in TestSafeConfigSelector (#5058)

This commit is contained in:
Shihao Xia 2021-12-22 13:56:46 -05:00 committed by GitHub
parent 956c594855
commit 7506755eb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -112,7 +112,7 @@ func (s) TestSafeConfigSelector(t *testing.T) {
cs1Done := false // set when cs2 is first called cs1Done := false // set when cs2 is first called
for dl := time.Now().Add(150 * time.Millisecond); !time.Now().After(dl); { for dl := time.Now().Add(150 * time.Millisecond); !time.Now().After(dl); {
gotConfigChan := make(chan *RPCConfig) gotConfigChan := make(chan *RPCConfig, 1)
go func() { go func() {
cfg, _ := scs.SelectConfig(testRPCInfo) cfg, _ := scs.SelectConfig(testRPCInfo)
gotConfigChan <- cfg gotConfigChan <- cfg