From e7d64c4f48e39f15ca55b0cd3b5c9fb3b5fca0f5 Mon Sep 17 00:00:00 2001 From: Todd Gruben Date: Mon, 4 Dec 2017 12:17:41 -0600 Subject: [PATCH] limit httpclient instances on executor tests --- test/executor.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/executor.go b/test/executor.go index 1cddfd521..f00692361 100644 --- a/test/executor.go +++ b/test/executor.go @@ -1,6 +1,7 @@ package test import ( + "net/http" "strings" "github.com/pilosa/pilosa" @@ -12,10 +13,16 @@ type Executor struct { *pilosa.Executor } +var remoteClient *http.Client + +func init() { + remoteClient = pilosa.GetHTTPClient(nil) +} + // NewExecutor returns a new instance of Executor. // The executor always matches the hostname of the first cluster node. func NewExecutor(holder *pilosa.Holder, cluster *pilosa.Cluster) *Executor { - executor := pilosa.NewExecutor(pilosa.GetHTTPClient(nil)) + executor := pilosa.NewExecutor(remoteClient) e := &Executor{Executor: executor} e.Holder = holder e.Cluster = cluster