AlexStocks commented on code in PR #3269:
URL: https://github.com/apache/dubbo-go/pull/3269#discussion_r2985392489


##########
registry/directory/directory_test.go:
##########
@@ -226,3 +231,112 @@ func TestToGroupInvokers(t *testing.T) {
                assert.Len(t, registryDirectory.toGroupInvokers(), 2)
        })
 }
+
+func TestRegistryDirectoryIsAvailableConcurrentWithCacheUpdates(t *testing.T) {

Review Comment:
   这里补了并发场景用例,但当前包在 `go test -race ./registry/directory` 下还是会报 race。触发点不是这几个新 
helper,而是这个测试文件里原有用例还在直接读 `registryDirectory.cacheInvokers`(例如 
`TestSubscribe`、`Test_Destroy`、`Test_RefreshUrl`)。既然这个 PR 的目标是把 directory 的共享状态 
race 收干净,建议把这些断言也改成通过 `snapshotCacheInvokers()` / `List()` 读取,或者在测试里统一走 
`invokersLock`,否则目录包的 race 检测结果仍然是红的。



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