From f7c588d2669dd02cb977fc225b9f560cc1098312 Mon Sep 17 00:00:00 2001 From: Joe Zou <yixian.zou@gmail.com> Date: Wed, 12 Feb 2020 23:23:02 +0800 Subject: [PATCH] fix review comment --- config_center/nacos/client_test.go | 5 ----- config_center/nacos/impl_test.go | 12 ++---------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/config_center/nacos/client_test.go b/config_center/nacos/client_test.go index 6408b244d..47a05dec6 100644 --- a/config_center/nacos/client_test.go +++ b/config_center/nacos/client_test.go @@ -1,7 +1,6 @@ package nacos import ( - "fmt" "strings" "testing" ) @@ -23,14 +22,10 @@ func Test_newNacosClient(t *testing.T) { done: make(chan struct{}), } err := ValidateNacosClient(c, WithNacosName(nacosClientName)) - if err != nil { - fmt.Println("nacos client start error ,error message is", err) - } assert.NoError(t, err) c.wg.Add(1) go HandleClientRestart(c) c.client.Close() <-c.client.Done() - fmt.Println("nacos client close done") c.Destroy() } diff --git a/config_center/nacos/impl_test.go b/config_center/nacos/impl_test.go index 27a9a0235..e5f5eb632 100644 --- a/config_center/nacos/impl_test.go +++ b/config_center/nacos/impl_test.go @@ -77,14 +77,10 @@ func initNacosData(t *testing.T) (*nacosDynamicConfiguration, error) { nacosURL := strings.ReplaceAll(server.URL, "http", "registry") regurl, _ := common.NewURL(nacosURL) nacosConfiguration, err := newNacosDynamicConfiguration(®url) - if err != nil { - fmt.Println("error:newNacosDynamicConfiguration", err.Error()) - assert.NoError(t, err) - return nil, err - } + assert.NoError(t, err) + nacosConfiguration.SetParser(&parser.DefaultConfigurationParser{}) - assert.NoError(t, err) return nacosConfiguration, err } @@ -104,10 +100,7 @@ func Test_AddListener(t *testing.T) { time.Sleep(time.Second * 2) nacos.AddListener("dubbo.properties", listener) listener.wg.Add(1) - fmt.Println("begin to listen") listener.wg.Wait() - fmt.Println("end", listener.event) - } func Test_RemoveListener(t *testing.T) { @@ -120,7 +113,6 @@ type mockDataListener struct { } func (l *mockDataListener) Process(configType *config_center.ConfigChangeEvent) { - fmt.Println("process!!!!!!!!!!") l.wg.Done() l.event = configType.Key } -- GitLab