Skip to content
Snippets Groups Projects
Commit 006d25a7 authored by cvictory's avatar cvictory
Browse files

fix #750. 1.fix unit test

parent 5cf5fe6f
No related branches found
No related tags found
No related merge requests found
...@@ -207,11 +207,11 @@ func Test_RefreshUrl(t *testing.T) { ...@@ -207,11 +207,11 @@ func Test_RefreshUrl(t *testing.T) {
mockRegistry.MockEvent(&registry.ServiceEvent{Action: remoting.EventTypeAdd, Service: providerUrl}) mockRegistry.MockEvent(&registry.ServiceEvent{Action: remoting.EventTypeAdd, Service: providerUrl})
time.Sleep(1e9) time.Sleep(1e9)
assert.Len(t, registryDirectory.cacheInvokers, 4) assert.Len(t, registryDirectory.cacheInvokers, 4)
mockRegistry.MockEvents([]*registry.ServiceEvent{&registry.ServiceEvent{Action: remoting.EventTypeAdd, Service: providerUrl}}) mockRegistry.MockEvents([]*registry.ServiceEvent{&registry.ServiceEvent{Action: remoting.EventTypeUpdate, Service: providerUrl}})
time.Sleep(1e9) time.Sleep(1e9)
assert.Len(t, registryDirectory.cacheInvokers, 1) assert.Len(t, registryDirectory.cacheInvokers, 1)
mockRegistry.MockEvents([]*registry.ServiceEvent{&registry.ServiceEvent{Action: remoting.EventTypeAdd, Service: providerUrl}, mockRegistry.MockEvents([]*registry.ServiceEvent{&registry.ServiceEvent{Action: remoting.EventTypeUpdate, Service: providerUrl},
&registry.ServiceEvent{Action: remoting.EventTypeAdd, Service: providerUrl2}}) &registry.ServiceEvent{Action: remoting.EventTypeUpdate, Service: providerUrl2}})
time.Sleep(1e9) time.Sleep(1e9)
assert.Len(t, registryDirectory.cacheInvokers, 2) assert.Len(t, registryDirectory.cacheInvokers, 2)
// clear all address // clear all address
......
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