Skip to content

Commit

Permalink
Fix heal tests
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
  • Loading branch information
Vladimir Popov committed Aug 12, 2021
1 parent 00adda2 commit 61d37c4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pkg/networkservice/chains/nsmgr/heal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func testNSMGRHealNSMgr(t *testing.T, nodeNum int, restored bool) {
} else {
domain.Nodes[nodeNum].NSMgr.Cancel()
// We need to be sure that Client has noticed NSMgr death
time.Sleep(time.Second)
time.Sleep(3 * time.Second)
domain.Nodes[nodeNum].NSMgr.Restart()
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/networkservice/chains/nsmgr/scale_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
func TestCreateEndpointDuringRequest(t *testing.T) {
t.Cleanup(func() { goleak.VerifyNone(t) })

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

defer cancel()
domain := sandbox.NewBuilder(ctx, t).
Expand Down
7 changes: 2 additions & 5 deletions pkg/networkservice/chains/nsmgr/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ func (s *nsmgrSuite) Test_ConnectToDeadNSEUsecase() {

request := defaultRequest(nsReg.Name)

reqCtx, reqCancel := context.WithTimeout(ctx, time.Second)
reqCtx, reqCancel := context.WithTimeout(ctx, 2*time.Second)
defer reqCancel()

conn, err := nsc.Request(reqCtx, request.Clone())
Expand All @@ -346,10 +346,7 @@ func (s *nsmgrSuite) Test_ConnectToDeadNSEUsecase() {
refreshRequest := request.Clone()
refreshRequest.Connection = conn.Clone()

refreshReqCtx, refreshReqCancel := context.WithTimeout(ctx, time.Second)
defer refreshReqCancel()

_, err = nsc.Request(refreshReqCtx, refreshRequest)
_, err = nsc.Request(ctx, refreshRequest)
require.Error(t, err)
require.NoError(t, reqCtx.Err())

Expand Down
2 changes: 1 addition & 1 deletion pkg/networkservice/common/heal/heal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,5 @@ func TestHeal_CloseChain(t *testing.T) {

require.Eventually(t, func() bool {
return counter.Closes() == 1
}, time.Second, 10*time.Millisecond)
}, 3*time.Second, 10*time.Millisecond)
}

0 comments on commit 61d37c4

Please sign in to comment.