Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestPool_Get测试无法通过 #38

Open
cuteLittleDevil opened this issue Apr 7, 2023 · 0 comments
Open

TestPool_Get测试无法通过 #38

cuteLittleDevil opened this issue Apr 7, 2023 · 0 comments

Comments

@cuteLittleDevil
Copy link

1 版本v1.0.0

TestPool_Get 测试方法中

	_, err = p.Get()
	if err != ErrMaxActiveConnReached {
		t.Errorf("Get error: %s", err)
	}

Get方法实现中

			c.mu.Lock()
			log.Debugf("openConn %v %v", c.openingConns, c.maxActive)
			if c.openingConns >= c.maxActive {
				req := make(chan connReq, 1)
				c.connReqs = append(c.connReqs, req)
				c.mu.Unlock()
				ret, ok := <-req
				if !ok {
					return nil, ErrMaxActiveConnReached
				}  			

ret, ok := <-req
目前在没有Put方法的情况下将永远阻塞 导致该测试无法完成

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant