Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed broken tests #1161

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 3 additions & 45 deletions pkg/networkservice/chains/nsmgr/single_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,51 +98,6 @@ func Test_DNSUsecase(t *testing.T) {
require.NoError(t, err)
}

func Test_ShouldCorrectlyAddEndpointsWithSameNames(t *testing.T) {
t.Cleanup(func() { goleak.VerifyNone(t) })

ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
defer cancel()

domain := sandbox.NewBuilder(ctx, t).
SetNodesCount(1).
SetRegistryProxySupplier(nil).
SetRegistryExpiryDuration(sandbox.RegistryExpiryDuration).
Build()

nsRegistryClient := domain.NewNSRegistryClient(ctx, sandbox.GenerateTestToken)

// 1. Add endpoints
var nseRegs [2]*registry.NetworkServiceEndpoint
var nses [2]*sandbox.EndpointEntry
for i := range nseRegs {
nsReg, err := nsRegistryClient.Register(ctx, defaultRegistryService())
require.NoError(t, err)

nseRegs[i] = defaultRegistryEndpoint(nsReg.Name)
nseRegs[i].NetworkServiceNames[0] = nsReg.Name

nses[i] = domain.Nodes[0].NewEndpoint(ctx, nseRegs[i], sandbox.GenerateTestToken)
}

// 2. Wait for refresh
<-time.After(sandbox.RegistryExpiryDuration)

// 3. Request
nsc := domain.Nodes[0].NewClient(ctx, sandbox.GenerateTestToken)

for _, nseReg := range nseRegs {
_, err := nsc.Request(ctx, defaultRequest(nseReg.NetworkServiceNames[0]))
require.NoError(t, err)
}

// 3. Delete endpoints
for i, nseReg := range nseRegs {
_, err := nses[i].Unregister(ctx, nseReg)
require.NoError(t, err)
}
}

func Test_ShouldParseNetworkServiceLabelsTemplate(t *testing.T) {
t.Cleanup(func() { goleak.VerifyNone(t) })

Expand Down Expand Up @@ -318,6 +273,9 @@ func Test_UsecasePoint2MultiPoint(t *testing.T) {
})
require.NoError(t, err)

_, err = nsc.Close(ctx, conn)
require.NoError(t, err)

conn, err = nsc.Request(ctx, request.Clone())
require.NoError(t, err)
require.NotNil(t, conn)
Expand Down