Browse Source

snapshot: ignore server logs

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Gyuho Lee 7 years ago
parent
commit
38e32a1b54
3 changed files with 13 additions and 0 deletions
  1. 1 0
      Makefile
  2. 3 0
      snapshot/member_test.go
  3. 9 0
      snapshot/v3_snapshot_test.go

+ 1 - 0
Makefile

@@ -26,6 +26,7 @@ clean:
 	rm -rf ./gopath
 	rm -rf ./gopath
 	rm -rf ./gopath.proto
 	rm -rf ./gopath.proto
 	rm -rf ./release
 	rm -rf ./release
+	rm -f ./snapshot/localhost:*
 	rm -f ./integration/127.0.0.1:* ./integration/localhost:*
 	rm -f ./integration/127.0.0.1:* ./integration/localhost:*
 	rm -f ./clientv3/integration/127.0.0.1:* ./clientv3/integration/localhost:*
 	rm -f ./clientv3/integration/127.0.0.1:* ./clientv3/integration/localhost:*
 	rm -f ./clientv3/ordering/127.0.0.1:* ./clientv3/ordering/localhost:*
 	rm -f ./clientv3/ordering/127.0.0.1:* ./clientv3/ordering/localhost:*

+ 3 - 0
snapshot/member_test.go

@@ -63,6 +63,9 @@ func TestSnapshotV3RestoreMultiMemberAdd(t *testing.T) {
 	time.Sleep(testutil.ApplyTimeout)
 	time.Sleep(testutil.ApplyTimeout)
 
 
 	cfg := embed.NewConfig()
 	cfg := embed.NewConfig()
+	cfg.Logger = "zap"
+	cfg.LogOutput = "io-discard"
+	cfg.Debug = false
 	cfg.Name = "3"
 	cfg.Name = "3"
 	cfg.InitialClusterToken = testClusterTkn
 	cfg.InitialClusterToken = testClusterTkn
 	cfg.ClusterState = "existing"
 	cfg.ClusterState = "existing"

+ 9 - 0
snapshot/v3_snapshot_test.go

@@ -43,6 +43,9 @@ func TestSnapshotV3RestoreSingle(t *testing.T) {
 	cURLs, pURLs := urls[:clusterN], urls[clusterN:]
 	cURLs, pURLs := urls[:clusterN], urls[clusterN:]
 
 
 	cfg := embed.NewConfig()
 	cfg := embed.NewConfig()
+	cfg.Logger = "zap"
+	cfg.LogOutput = "io-discard"
+	cfg.Debug = false
 	cfg.Name = "s1"
 	cfg.Name = "s1"
 	cfg.InitialClusterToken = testClusterTkn
 	cfg.InitialClusterToken = testClusterTkn
 	cfg.ClusterState = "existing"
 	cfg.ClusterState = "existing"
@@ -149,6 +152,9 @@ func createSnapshotFile(t *testing.T, kvs []kv) string {
 	cURLs, pURLs := urls[:clusterN], urls[clusterN:]
 	cURLs, pURLs := urls[:clusterN], urls[clusterN:]
 
 
 	cfg := embed.NewConfig()
 	cfg := embed.NewConfig()
+	cfg.Logger = "zap"
+	cfg.LogOutput = "io-discard"
+	cfg.Debug = false
 	cfg.Name = "default"
 	cfg.Name = "default"
 	cfg.ClusterState = "new"
 	cfg.ClusterState = "new"
 	cfg.LCUrls, cfg.ACUrls = cURLs, cURLs
 	cfg.LCUrls, cfg.ACUrls = cURLs, cURLs
@@ -213,6 +219,9 @@ func restoreCluster(t *testing.T, clusterN int, dbPath string) (
 	cfgs := make([]*embed.Config, clusterN)
 	cfgs := make([]*embed.Config, clusterN)
 	for i := 0; i < clusterN; i++ {
 	for i := 0; i < clusterN; i++ {
 		cfg := embed.NewConfig()
 		cfg := embed.NewConfig()
+		cfg.Logger = "zap"
+		cfg.LogOutput = "io-discard"
+		cfg.Debug = false
 		cfg.Name = fmt.Sprintf("%d", i)
 		cfg.Name = fmt.Sprintf("%d", i)
 		cfg.InitialClusterToken = testClusterTkn
 		cfg.InitialClusterToken = testClusterTkn
 		cfg.ClusterState = "existing"
 		cfg.ClusterState = "existing"