From 102a6e723b6574153f877f39ecd4d7fef5db9c48 Mon Sep 17 00:00:00 2001 From: Matthew Jaffee Date: Fri, 11 Feb 2022 08:51:10 -0600 Subject: [PATCH 1/3] more binding to 0==less port conflicts in CI --- cmd/server_test.go | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/cmd/server_test.go b/cmd/server_test.go index 91263c0ed..df47bed5f 100644 --- a/cmd/server_test.go +++ b/cmd/server_test.go @@ -37,7 +37,7 @@ func TestServerConfig(t *testing.T) { tests := []commandTest{ // TEST 0 { - args: []string{"server", "--data-dir", actualDataDir, "--bind", "localhost:42454", "--bind-grpc", "localhost:30112", "--translation.map-size", "100000"}, + args: []string{"server", "--data-dir", actualDataDir, "--translation.map-size", "100000"}, env: map[string]string{ "PILOSA_DATA_DIR": "/tmp/myEnvDatadir", "PILOSA_LONG_QUERY_TIME": "1m30s", @@ -56,6 +56,10 @@ func TestServerConfig(t *testing.T) { [cluster] replicas = 2 long-query-time = "1m10s" + [etcd] + listen-client-address = "http://localhost:0" + listen-peer-address = "http://localhost:0" + initial-cluster = "pilosa0=http://localhost:0" [profile] block-rate = 100 mutex-fraction = 10 @@ -63,7 +67,6 @@ func TestServerConfig(t *testing.T) { validation: func() error { v := validator{} v.Check(cmd.Server.Config.DataDir, actualDataDir) - v.Check(cmd.Server.Config.Bind, "localhost:42454") v.Check(cmd.Server.Config.Cluster.ReplicaN, 2) v.Check(cmd.Server.Config.LongQueryTime, toml.Duration(time.Second*90)) v.Check(cmd.Server.Config.Cluster.LongQueryTime, toml.Duration(time.Second*90)) @@ -83,7 +86,6 @@ func TestServerConfig(t *testing.T) { }, env: map[string]string{ "PILOSA_CLUSTER_HOSTS": "localhost:1110,localhost:1111", - "PILOSA_BIND": "localhost:1110", "PILOSA_TRANSLATION_MAP_SIZE": "100000", "PILOSA_PROFILE_BLOCK_RATE": "9123", "PILOSA_PROFILE_MUTEX_FRACTION": "444", @@ -92,6 +94,10 @@ func TestServerConfig(t *testing.T) { bind = ` + nextPort() + ` bind-grpc = ` + nextPort() + ` data-dir = "` + actualDataDir + `" + [etcd] + listen-client-address = "http://localhost:0" + listen-peer-address = "http://localhost:0" + initial-cluster = "pilosa0=http://localhost:0" [profile] block-rate = 100 mutex-fraction = 10 @@ -110,9 +116,13 @@ func TestServerConfig(t *testing.T) { args: []string{"server", "--log-path", logFile.Name(), "--translation.map-size", "100000"}, env: map[string]string{}, cfgFileContent: ` - bind = "localhost:19444" - bind-grpc = "localhost:29444" + bind = ` + nextPort() + ` + bind-grpc = ` + nextPort() + ` data-dir = "` + actualDataDir + `" + [etcd] + listen-client-address = "http://localhost:0" + listen-peer-address = "http://localhost:0" + initial-cluster = "pilosa0=http://localhost:0" [anti-entropy] interval = "11m0s" [metric] @@ -191,6 +201,10 @@ func TestServerConfig_DeprecateLongQueryTime(t *testing.T) { bind = ` + nextPort() + ` bind-grpc = ` + nextPort() + ` data-dir = "` + actualDataDir + `" + [etcd] + listen-client-address = "http://localhost:0" + listen-peer-address = "http://localhost:0" + initial-cluster = "pilosa0=http://localhost:0" `, validation: func() error { v := validator{} @@ -207,6 +221,10 @@ func TestServerConfig_DeprecateLongQueryTime(t *testing.T) { bind = ` + nextPort() + ` bind-grpc = ` + nextPort() + ` data-dir = "` + actualDataDir + `" + [etcd] + listen-client-address = "http://localhost:0" + listen-peer-address = "http://localhost:0" + initial-cluster = "pilosa0=http://localhost:0" `, validation: func() error { v := validator{} @@ -223,6 +241,10 @@ func TestServerConfig_DeprecateLongQueryTime(t *testing.T) { bind = ` + nextPort() + ` bind-grpc = ` + nextPort() + ` data-dir = "` + actualDataDir + `" + [etcd] + listen-client-address = "http://localhost:0" + listen-peer-address = "http://localhost:0" + initial-cluster = "pilosa0=http://localhost:0" `, validation: func() error { v := validator{} From 53a33134d9024aa19976fbf171b699b4767663d3 Mon Sep 17 00:00:00 2001 From: Matthew Jaffee Date: Fri, 11 Feb 2022 09:41:11 -0600 Subject: [PATCH 2/3] add verbose output to race tests --- .gitlab/.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 84ee2acce..75bf09877 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -90,7 +90,7 @@ run go tests race: retry: 1 script: - echo "Running featurebase race tests..." - - go test -race -timeout=90m ./... + - go test -race -v -timeout=90m ./... tags: - aws From b5dae698ffd93ab0a5bf4cbc139c4ffb1a2bd7b3 Mon Sep 17 00:00:00 2001 From: Matthew Jaffee Date: Fri, 11 Feb 2022 09:48:18 -0600 Subject: [PATCH 3/3] remove unused env var from test cluster.hosts is no longer a config option since move to etcd --- cmd/server_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/server_test.go b/cmd/server_test.go index df47bed5f..e7b42002f 100644 --- a/cmd/server_test.go +++ b/cmd/server_test.go @@ -85,7 +85,6 @@ func TestServerConfig(t *testing.T) { "--profile.mutex-fraction", "8290", }, env: map[string]string{ - "PILOSA_CLUSTER_HOSTS": "localhost:1110,localhost:1111", "PILOSA_TRANSLATION_MAP_SIZE": "100000", "PILOSA_PROFILE_BLOCK_RATE": "9123", "PILOSA_PROFILE_MUTEX_FRACTION": "444",