Skip to content

Commit

Permalink
fix #750. 1.fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
cvictory committed Sep 25, 2020
1 parent eb1b730 commit 3352d96
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions registry/directory/directory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@ func Test_RefreshUrl(t *testing.T) {
mockRegistry.MockEvent(&registry.ServiceEvent{Action: remoting.EventTypeAdd, Service: providerUrl})
time.Sleep(1e9)
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.EventTypgeUpdate, Service: providerUrl}})
time.Sleep(1e9)
assert.Len(t, registryDirectory.cacheInvokers, 1)
mockRegistry.MockEvents([]*registry.ServiceEvent{&registry.ServiceEvent{Action: remoting.EventTypeAdd, Service: providerUrl},
&registry.ServiceEvent{Action: remoting.EventTypeAdd, Service: providerUrl2}})
mockRegistry.MockEvents([]*registry.ServiceEvent{&registry.ServiceEvent{Action: remoting.EventTypeUpdate, Service: providerUrl},
&registry.ServiceEvent{Action: remoting.EventTypeUpdate, Service: providerUrl2}})
time.Sleep(1e9)
assert.Len(t, registryDirectory.cacheInvokers, 2)
// clear all address
Expand Down

0 comments on commit 3352d96

Please sign in to comment.