This is an automated email from the ASF dual-hosted git repository.
alexstocks pushed a commit to branch 1.5
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git
The following commit(s) were added to refs/heads/1.5 by this push:
new 6b190b8 fix 1.5 ut (#1204)
6b190b8 is described below
commit 6b190b84b3578dc808761828b05ef8b1f72b8555
Author: gaoxinge <[email protected]>
AuthorDate: Sat May 15 18:54:46 2021 +0800
fix 1.5 ut (#1204)
* update
* update
---
registry/nacos/service_discovery_test.go | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/registry/nacos/service_discovery_test.go
b/registry/nacos/service_discovery_test.go
index e073756..4902eb3 100644
--- a/registry/nacos/service_discovery_test.go
+++ b/registry/nacos/service_discovery_test.go
@@ -37,9 +37,7 @@ import (
"github.com/apache/dubbo-go/registry"
)
-var (
- testName = "test"
-)
+var testName = "test"
func Test_newNacosServiceDiscovery(t *testing.T) {
name := "nacos1"
@@ -67,7 +65,6 @@ func Test_newNacosServiceDiscovery(t *testing.T) {
res, err := newNacosServiceDiscovery(name)
assert.Nil(t, err)
assert.NotNil(t, res)
-
}
func TestNacosServiceDiscovery_CRUD(t *testing.T) {
@@ -111,8 +108,8 @@ func TestNacosServiceDiscovery_CRUD(t *testing.T) {
err = serviceDiscovery.Register(instance)
assert.Nil(t, err)
- //sometimes nacos may be failed to push update of instance,
- //so it need 10s to pull, we sleep 10 second to make sure instance has
been update
+ // sometimes nacos may be failed to push update of instance,
+ // so it need 10s to pull, we sleep 10 second to make sure instance has
been update
time.Sleep(11 * time.Second)
page := serviceDiscovery.GetHealthyInstancesByPage(serviceName, 0, 10,
true)
assert.NotNil(t, page)
@@ -126,7 +123,7 @@ func TestNacosServiceDiscovery_CRUD(t *testing.T) {
assert.Equal(t, host, instance.GetHost())
assert.Equal(t, port, instance.GetPort())
// TODO: console.nacos.io has updated to nacos 2.0 and serviceName has
changed in 2.0, so ignore temporarily.
- //assert.Equal(t, serviceName, instance.GetServiceName())
+ // assert.Equal(t, serviceName, instance.GetServiceName())
assert.Equal(t, 0, len(instance.GetMetadata()))
instance.Metadata["a"] = "b"