Skip to content

Commit

Permalink
heal: fix TestNSMGR_HealForwarder and remove grpc.WaitTillReady() and…
Browse files Browse the repository at this point in the history
… grpc.WithBlock() from sandbox.DialOptions()

Signed-off-by: Ed Warnicke <hagbard@gmail.com>
  • Loading branch information
edwarnicke committed Oct 18, 2021
1 parent e6559b4 commit 003fbea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 4 additions & 4 deletions pkg/networkservice/chains/nsmgr/heal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ func testNSMGRHealForwarder(t *testing.T, nodeNum int) {
domain.Nodes[nodeNum].NewForwarder(ctx, forwarderReg, sandbox.GenerateTestToken)

// Wait reconnecting through the new Forwarder
require.Eventually(t, checkSecondRequestsReceived(counter.UniqueRequests), timeout, tick)
require.Equal(t, 2, counter.UniqueRequests())
require.Eventually(t, checkSecondRequestsReceived(counter.Requests), timeout, tick)
require.Equal(t, 2, counter.Requests())
closes := counter.UniqueCloses()

// Check refresh
Expand All @@ -188,8 +188,8 @@ func testNSMGRHealForwarder(t *testing.T, nodeNum int) {
_, err = nsc.Close(ctx, conn)
require.NoError(t, err)

require.Equal(t, 2, counter.UniqueRequests())
require.Equal(t, closes+1, counter.UniqueCloses())
require.Equal(t, 3, counter.Requests())
require.Equal(t, closes+1, counter.Closes())
}

func TestNSMGR_HealNSMgr(t *testing.T) {
Expand Down
2 changes: 0 additions & 2 deletions pkg/tools/sandbox/dial_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ func DialOptions(options ...DialOption) []grpc.DialOption {
grpc.WithTransportCredentials(
grpcfdTransportCredentials(insecure.NewCredentials()),
),
grpc.WithBlock(),
grpc.WithDefaultCallOptions(
grpc.WaitForReady(true),
grpc.PerRPCCredentials(token.NewPerRPCCredentials(opts.tokenGenerator)),
),
grpcfd.WithChainStreamInterceptor(),
Expand Down

0 comments on commit 003fbea

Please sign in to comment.