Update selector race, rename cache selector
This commit is contained in:
@@ -6,14 +6,14 @@ import (
|
||||
"github.com/micro/go-micro/registry/mock"
|
||||
)
|
||||
|
||||
func TestDefaultSelector(t *testing.T) {
|
||||
func TestRegistrySelector(t *testing.T) {
|
||||
counts := map[string]int{}
|
||||
|
||||
rs := newDefaultSelector(Registry(mock.NewRegistry()))
|
||||
cache := NewSelector(Registry(mock.NewRegistry()))
|
||||
|
||||
next, err := rs.Select("foo")
|
||||
next, err := cache.Select("foo")
|
||||
if err != nil {
|
||||
t.Errorf("Unexpected error calling default select: %v", err)
|
||||
t.Errorf("Unexpected error calling cache select: %v", err)
|
||||
}
|
||||
|
||||
for i := 0; i < 100; i++ {
|
||||
@@ -24,5 +24,5 @@ func TestDefaultSelector(t *testing.T) {
|
||||
counts[node.Id]++
|
||||
}
|
||||
|
||||
t.Logf("Default Counts %v", counts)
|
||||
t.Logf("Selector Counts %v", counts)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user