cmd/swarm: move initCluster to run_test.go

This commit is contained in:
Anton Evangelatov 2018-11-19 12:31:49 +01:00
parent eb0c5cf630
commit ad8a782a82
2 changed files with 11 additions and 12 deletions

View file

@ -30,7 +30,6 @@ import (
"os" "os"
"runtime" "runtime"
"strings" "strings"
"sync"
"testing" "testing"
"time" "time"
@ -50,17 +49,6 @@ const (
var DefaultCurve = crypto.S256() var DefaultCurve = crypto.S256()
const clusterSize = 3
var clusteronce sync.Once
var cluster *testCluster
func initCluster(t *testing.T) {
clusteronce.Do(func() {
cluster = newTestCluster(t, clusterSize)
})
}
func TestACT(t *testing.T) { func TestACT(t *testing.T) {
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
t.Skip() t.Skip()

View file

@ -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 { func serverFunc(api *api.API) swarmhttp.TestServer {
return swarmhttp.NewServer(api, "") return swarmhttp.NewServer(api, "")
} }