Skip to content
Snippets Groups Projects
Unverified Commit 6b190b84 authored by gaoxinge's avatar gaoxinge Committed by GitHub
Browse files

fix 1.5 ut (#1204)

* update

* update
parent 3df419d0
No related branches found
Tags v1.5.7-rc1 v1.5.7-rc1-tmp
No related merge requests found
......@@ -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"
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment