Thanks to visit codestin.com
Credit goes to github.com

Skip to content

TestPool_Get测试无法通过 #38

@cuteLittleDevil

Description

@cuteLittleDevil

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方法的情况下将永远阻塞 导致该测试无法完成

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions