diff --git a/registry/etcdv3/listener.go b/registry/etcdv3/listener.go index 963f01b28b540e3864e6966e833f793ae3417d55..a8f2facc1aa43db4daea77c03f332df16f302431 100644 --- a/registry/etcdv3/listener.go +++ b/registry/etcdv3/listener.go @@ -70,7 +70,7 @@ func (l *configurationListener) Next() (*registry.ServiceEvent, error) { return nil, perrors.New("listener stopped") case e := <-l.events: - logger.Infof("got etcd event %#s", e) + logger.Infof("got etcd event %#v", e) if e.ConfigType == remoting.EventTypeDel { select { case <-l.registry.done: diff --git a/remoting/etcdv3/facede_test.go b/remoting/etcdv3/facede_test.go deleted file mode 100644 index 702aaece817283eafd7b7db96b8bb076f1b30cd7..0000000000000000000000000000000000000000 --- a/remoting/etcdv3/facede_test.go +++ /dev/null @@ -1,71 +0,0 @@ -package etcdv3 - -import ( - "context" - "sync" - "time" -) - -import ( - "github.com/apache/dubbo-go/common" -) - -type mockFacade struct { - client *Client - cltLock sync.Mutex - wg sync.WaitGroup - URL *common.URL - done chan struct{} -} - -func (r *mockFacade) Client() *Client { - return r.client -} - -func (r *mockFacade) SetClient(client *Client) { - r.client = client -} - -func (r *mockFacade) ClientLock() *sync.Mutex { - return &r.cltLock -} - -func (r *mockFacade) WaitGroup() *sync.WaitGroup { - return &r.wg -} - -func (r *mockFacade) GetDone() chan struct{} { - return r.done -} - -func (r *mockFacade) GetUrl() common.URL { - return *r.URL -} - -func (r *mockFacade) Destroy() { - close(r.done) - r.wg.Wait() -} - -func (r *mockFacade) RestartCallBack() bool { - return true -} -func (r *mockFacade) IsAvailable() bool { - return true -} - -func (suite *ClientTestSuite) TestFacade() { - - c := suite.client - t := suite.T() - - url, err := common.NewURL(context.Background(), "mock://127.0.0.1:2379") - if err != nil { - t.Fatal(err) - } - mock := &mockFacade{client: c, URL: &url} - go HandleClientRestart(mock) - c.Close() - - time.Sleep(2 * time.Second) -}