From 6b6c4d1c2754f8dd70172ab58d7ee33cf9058c7d Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Mon, 19 Nov 2018 14:57:22 +0100 Subject: cmd/swarm: speed up tests - use global cluster (#18129) --- cmd/swarm/run_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'cmd/swarm/run_test.go') diff --git a/cmd/swarm/run_test.go b/cmd/swarm/run_test.go index 416fa7a50..680d238d0 100644 --- a/cmd/swarm/run_test.go +++ b/cmd/swarm/run_test.go @@ -57,6 +57,17 @@ func init() { }) } +const clusterSize = 3 + +var clusteronce sync.Once +var cluster *testCluster + +func initCluster(t *testing.T) { + clusteronce.Do(func() { + cluster = newTestCluster(t, clusterSize) + }) +} + func serverFunc(api *api.API) swarmhttp.TestServer { return swarmhttp.NewServer(api, "") } -- cgit v1.2.3