From 4c1628850203783b52dcb4cd96200fb16ec9563d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Thu, 21 Feb 2019 17:13:38 +0100 Subject: [PATCH] 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 --- pool_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pool_test.go b/pool_test.go index 7f96e64..3ec251d 100644 --- a/pool_test.go +++ b/pool_test.go @@ -24,7 +24,11 @@ func TestAllocatePortInUse(t *testing.T) { // make the pool use the port already in use via a port range _, portStr, _ := net.SplitHostPort(l.Addr().String()) 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 { t.Fatal(err) }