Skip to content

Commit

Permalink
add some logs
Browse files Browse the repository at this point in the history
Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>
  • Loading branch information
NikitaSkrynnik committed Oct 31, 2023
1 parent 36b47ec commit 21ea102
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 5 additions & 0 deletions pkg/registry/common/begin/fifo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (

"github.com/networkservicemesh/sdk/pkg/registry/common/begin"
"github.com/networkservicemesh/sdk/pkg/registry/core/next"
"github.com/networkservicemesh/sdk/pkg/tools/log"
)

func TestFIFOSequence(t *testing.T) {
Expand Down Expand Up @@ -107,6 +108,10 @@ func TestFIFOSequence(t *testing.T) {
defer collector.mu.Unlock()
registrations := collector.registrations

for i, registration := range registrations {
log.FromContext(ctx).Infof("i: %v, type: %v, registration: %v", i, registration.requestType, registration.requestData)
}

for i, registration := range registrations {
require.Equal(t, registration.requestData.Url, expected[i].requestData.Url)
require.Equal(t, registration.requestType, expected[i].requestType)
Expand Down
2 changes: 0 additions & 2 deletions pkg/registry/common/begin/nse_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (

"github.com/networkservicemesh/sdk/pkg/registry/common/grpcmetadata"
"github.com/networkservicemesh/sdk/pkg/registry/core/next"
"github.com/networkservicemesh/sdk/pkg/tools/log"
)

type beginNSEServer struct {
Expand Down Expand Up @@ -58,7 +57,6 @@ func (b *beginNSEServer) Register(ctx context.Context, in *registry.NetworkServi
<-eventFactoryServer.executor.AsyncExec(func() {
currentEventFactoryServer, _ := b.Load(id)
if currentEventFactoryServer != eventFactoryServer {
log.FromContext(ctx).Debug("recalling begin.Request because currentEventFactoryServer != eventFactoryServer")
resp, err = b.Register(ctx, in)
return
}
Expand Down

0 comments on commit 21ea102

Please sign in to comment.