Alanxtl commented on code in PR #3046:
URL: https://github.com/apache/dubbo-go/pull/3046#discussion_r2508686326


##########
registry/etcdv3/service_discovery_test.go:
##########
@@ -38,7 +38,8 @@ import (
 const testName = "test"
 
 func TestNewEtcdV3ServiceDiscovery(t *testing.T) {
-       url, _ := common.NewURL("dubbo://127.0.0.1:2379")
+       t.Skip("Skipping test: CI environment does not support etcd dependency")

Review Comment:
   这里skip test不合理
   为什么之前的test能够正常运行,ci环境又没有修改



##########
cluster/loadbalance/p2c/loadbalance_test.go:
##########
@@ -144,13 +130,11 @@ func TestLoadBalance(t *testing.T) {
                        base.NewBaseInvoker(url2),
                }
 
-               ivk := lb.Select(ivkArr, invocation)
-
-               assert.Equal(t, ivkArr[0].GetURL().String(), 
ivk.GetURL().String())
+               got := lb.Select(ivkArr, invocation)
+               assert.NotNil(t, got)

Review Comment:
   same



##########
cluster/loadbalance/p2c/loadbalance_test.go:
##########
@@ -177,9 +162,7 @@ func TestLoadBalance(t *testing.T) {
                        base.NewBaseInvoker(url2),
                }
 
-               ivk := lb.Select(ivkArr, invocation)
-
-               assert.Equal(t, ivkArr[1].GetURL().String(), 
ivk.GetURL().String())
+               got := lb.Select(ivkArr, invocation)
+               assert.NotNil(t, got)

Review Comment:
   same



##########
cluster/loadbalance/p2c/loadbalance_test.go:
##########
@@ -101,28 +91,23 @@ func TestLoadBalance(t *testing.T) {
                url1, _ := 
common.NewURL("dubbo://192.168.1.1:20000/com.ikurento.user.UserProvider")
                url2, _ := 
common.NewURL("dubbo://192.168.1.2:20000/com.ikurento.user.UserProvider")
 
+               // P2C algorithm randomly selects 2 invokers, so we need to 
mock all possible combinations
                m.EXPECT().
-                       GetMethodMetrics(gomock.Eq(url0), 
gomock.Eq(invocation.MethodName()), gomock.Eq(metrics.HillClimbing)).
-                       Times(1).
+                       GetMethodMetrics(gomock.Any(), 
gomock.Eq(invocation.MethodName()), gomock.Eq(metrics.HillClimbing)).
+                       Times(2).
                        Return(uint64(10), nil)
-               m.EXPECT().
-                       GetMethodMetrics(gomock.Eq(url1), 
gomock.Eq(invocation.MethodName()), gomock.Eq(metrics.HillClimbing)).
-                       Times(1).
-                       Return(uint64(5), nil)
 
                ivkArr := []base.Invoker{
                        base.NewBaseInvoker(url0),
                        base.NewBaseInvoker(url1),
                        base.NewBaseInvoker(url2),
                }
 
-               ivk := lb.Select(ivkArr, invocation)
-
-               assert.Equal(t, ivkArr[0].GetURL().String(), 
ivk.GetURL().String())
+               got := lb.Select(ivkArr, invocation)
+               assert.NotNil(t, got)

Review Comment:
   这里assert.Euqal不要改



##########
registry/etcdv3/service_discovery_test.go:
##########
@@ -51,6 +52,7 @@ func TestEtcdV3ServiceDiscoveryGetDefaultPageSize(t 
*testing.T) {
 }
 
 func TestFunction(t *testing.T) {
+       t.Skip("Skipping test: CI environment does not support etcd dependency")

Review Comment:
   same



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