diff --git a/registry/directory/directory_test.go b/registry/directory/directory_test.go index e02cff64a1..f06cccb454 100644 --- a/registry/directory/directory_test.go +++ b/registry/directory/directory_test.go @@ -207,11 +207,11 @@ func Test_RefreshUrl(t *testing.T) { mockRegistry.MockEvent(®istry.ServiceEvent{Action: remoting.EventTypeAdd, Service: providerUrl}) time.Sleep(1e9) assert.Len(t, registryDirectory.cacheInvokers, 4) - mockRegistry.MockEvents([]*registry.ServiceEvent{®istry.ServiceEvent{Action: remoting.EventTypeAdd, Service: providerUrl}}) + mockRegistry.MockEvents([]*registry.ServiceEvent{®istry.ServiceEvent{Action: remoting.EventTypgeUpdate, Service: providerUrl}}) time.Sleep(1e9) assert.Len(t, registryDirectory.cacheInvokers, 1) - mockRegistry.MockEvents([]*registry.ServiceEvent{®istry.ServiceEvent{Action: remoting.EventTypeAdd, Service: providerUrl}, - ®istry.ServiceEvent{Action: remoting.EventTypeAdd, Service: providerUrl2}}) + mockRegistry.MockEvents([]*registry.ServiceEvent{®istry.ServiceEvent{Action: remoting.EventTypeUpdate, Service: providerUrl}, + ®istry.ServiceEvent{Action: remoting.EventTypeUpdate, Service: providerUrl2}}) time.Sleep(1e9) assert.Len(t, registryDirectory.cacheInvokers, 2) // clear all address