XnLemon commented on code in PR #3369:
URL: https://github.com/apache/dubbo-go/pull/3369#discussion_r3369254919


##########
metadata/report_instance.go:
##########
@@ -41,6 +42,12 @@ var (
        instances = make(map[string]report.MetadataReport)
 )
 
+// ClearMetadataReportInstances resets the package-level instances map.
+// Intended for test isolation only; do not call in production code.
+func ClearMetadataReportInstances() {
+       instances = make(map[string]report.MetadataReport)
+}

Review Comment:
   因为新增了跨包测试文件 举个例子 比如 TestListenerUsesRegistryIdToFetchRemoteMetadata 要验证 
registryId 从 NewServiceInstancesChangedListener → OnEvent → GetMetadataInfo → 
GetMetadataFromMetadataReport → 最终调到正确的那个 report 实例。这条链路跨了 3 个 package和 5 个函数 
中间每一步都读全局 instances
   需要覆盖的话就得加上 不覆盖的话测对应每一层不代表连起来就能成 所以还是加上了(
   您怎么看owo (



-- 
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