NeverENG commented on code in PR #3690:
URL: https://github.com/apache/dubbo-go/pull/3690#discussion_r3829913363
##########
config_center/zookeeper/impl_test.go:
##########
@@ -66,11 +66,11 @@ func TestGetPath(t *testing.T) {
}
func TestPublishAndRemoveConfigWithMockZk(t *testing.T) {
- cluster, client, _, err := gxzookeeper.NewMockZookeeperClient("test",
5e9)
+ client, _, err := gxzookeeper.NewZookeeperClientFromEnv("test", 5e9)
if err != nil {
t.Skipf("skip mock zk setup: %v", err)
}
- defer cluster.Stop()
+ defer client.Close()
Review Comment:
Fixed in ccbcc971: each test now generates a random, test-specific root path
instead of the fixed `/dubbo/config`, and removes it via t.Cleanup (registered
so cleanup runs before the client is closed). Verified two consecutive runs
against a live ZooKeeper leave no leftover znodes and touch no pre-existing
data.
##########
config_center/zookeeper/impl_test.go:
##########
@@ -66,11 +66,11 @@ func TestGetPath(t *testing.T) {
}
func TestPublishAndRemoveConfigWithMockZk(t *testing.T) {
- cluster, client, _, err := gxzookeeper.NewMockZookeeperClient("test",
5e9)
+ client, _, err := gxzookeeper.NewZookeeperClientFromEnv("test", 5e9)
if err != nil {
t.Skipf("skip mock zk setup: %v", err)
Review Comment:
已在 ccbcc971 修复(合并 develop 后在 8d3505f6 中重新应用到新的 unit-test job):
1. CI job 增加 `zookeeper:3.9` service 容器(映射 2181)并加了就绪等待步骤,两个迁移回归测试在默认 CI
中会真实执行;
2. 新增 failOrSkipZkUnavailable:检测到 `CI` 环境变量(GitHub Actions 自动设置)时 zk 不可达直接
Fail 而不是 Skip,杜绝静默跳过绿色合并;本地开发无 zk 时仍然优雅 skip。
已验证 CI=true 且无 zk 时测试确实失败、无 CI 变量时正常 skip、有 zk 时两遍全绿无残留节点。
--
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]