skip the error log in TestAllocatePortInUse

We know we're going to see an error, so don't log it too:

	$ go test -run TestAllocatePortInUse
	2019/02/21 17:11:34 ERROR: pool could not allocate runner ...
	PASS
	ok      github.com/chromedp/chromedp    0.004s
This commit is contained in:
Daniel Martí 2019-02-21 17:13:38 +01:00
parent da4f783362
commit 4c16288502

View File

@ -24,7 +24,11 @@ func TestAllocatePortInUse(t *testing.T) {
// make the pool use the port already in use via a port range // make the pool use the port already in use via a port range
_, portStr, _ := net.SplitHostPort(l.Addr().String()) _, portStr, _ := net.SplitHostPort(l.Addr().String())
port, _ := strconv.Atoi(portStr) port, _ := strconv.Atoi(portStr)
pool, err := NewPool(PortRange(port, port+1)) pool, err := NewPool(
PortRange(port, port+1),
// skip the error log from the used port
PoolLog(nil, nil, func(string, ...interface{}) {}),
)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }