diff --git a/pkg/registry/common/memory/ns_server_test.go b/pkg/registry/common/memory/ns_server_test.go index 2ef56160b2..77f1d4d114 100644 --- a/pkg/registry/common/memory/ns_server_test.go +++ b/pkg/registry/common/memory/ns_server_test.go @@ -173,17 +173,13 @@ func TestNetworkServiceRegistryServer_SlowReceiver(t *testing.T) { findCtx, findCancel := context.WithCancel(ctx) stream, err := c.Find(findCtx, ®istry.NetworkServiceQuery{ - NetworkService: ®istry.NetworkService{Name: "ns-1"}, + NetworkService: ®istry.NetworkService{Name: "ns"}, Watch: true, }) require.NoError(t, err) - for i := 0; i < 100; i++ { - var ns *registry.NetworkService - ns, err = s.Register(ctx, ®istry.NetworkService{Name: "ns-1"}) - require.NoError(t, err) - - _, err = s.Unregister(ctx, ns) + for i := 0; i < 200; i++ { + _, err = s.Register(ctx, ®istry.NetworkService{Name: fmt.Sprintf("ns-%d", i)}) require.NoError(t, err) } diff --git a/pkg/registry/common/memory/nse_server_test.go b/pkg/registry/common/memory/nse_server_test.go index e9ba53f8f9..e187e0be86 100644 --- a/pkg/registry/common/memory/nse_server_test.go +++ b/pkg/registry/common/memory/nse_server_test.go @@ -240,17 +240,13 @@ func TestNetworkServiceEndpointRegistryServer_SlowReceiver(t *testing.T) { findCtx, findCancel := context.WithCancel(ctx) stream, err := c.Find(findCtx, ®istry.NetworkServiceEndpointQuery{ - NetworkServiceEndpoint: ®istry.NetworkServiceEndpoint{Name: "nse-1"}, + NetworkServiceEndpoint: ®istry.NetworkServiceEndpoint{Name: "nse"}, Watch: true, }) require.NoError(t, err) - for i := 0; i < 100; i++ { - var nse *registry.NetworkServiceEndpoint - nse, err = s.Register(ctx, ®istry.NetworkServiceEndpoint{Name: "nse-1"}) - require.NoError(t, err) - - _, err = s.Unregister(ctx, nse) + for i := 0; i < 200; i++ { + _, err = s.Register(ctx, ®istry.NetworkServiceEndpoint{Name: fmt.Sprintf("nse-%d", i)}) require.NoError(t, err) }