chaojixinren commented on code in PR #3635:
URL: https://github.com/apache/dubbo-go/pull/3635#discussion_r3747636236


##########
metadata/report/zookeeper/report.go:
##########
@@ -211,14 +212,29 @@ func (m *zookeeperMetadataReport) 
RemoveServiceAppMappingListener(key string, gr
 
 type zookeeperMetadataReportFactory struct{}
 
-// CreateMetadataReport creates the zookeeper-based metadata report 
implementation.
-func (mf *zookeeperMetadataReportFactory) CreateMetadataReport(url 
*common.URL) report.MetadataReport {
-       client, err := gxzookeeper.NewZookeeperClient(
-               "zookeeperMetadataReport",
+// newZookeeperClient is a stub point for tests. It takes a plain timeout
+// instead of gost's unexported option type so tests can replace it.
+var newZookeeperClient = func(name string, zkAddrs []string, share bool, 
timeout time.Duration) (*gxzookeeper.ZookeeperClient, error) {
+       return gxzookeeper.NewZookeeperClient(name, zkAddrs, share, 
gxzookeeper.WithZkTimeOut(timeout))
+}

Review Comment:
   已按去掉包装层,CreateMetadataReport 直接调用 gxzookeeper.NewZookeeperClient。原来依赖 stub 
的那个单测一并删除。改完后本地已重新验证:相关 7 包 -race 通过、全量 make test 、e2e 通过



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to