Skip to content

Commit

Permalink
use context with timeout for testing
Browse files Browse the repository at this point in the history
Signed-off-by: Denis Tingaikin <[email protected]>
  • Loading branch information
denis-tingaikin committed Jul 11, 2024
1 parent a14c28d commit e6d0f80
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/networkservice/mechanisms/kernel/kerneltap/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ func del(ctx context.Context, conn *networkservice.Connection, vppConn api.Conne
return nil
}
now := time.Now()
_, err := tapv2.NewServiceClient(vppConn).TapDeleteV2(context.Background(), &tapv2.TapDeleteV2{
delCtx, cancel := context.WithTimeout(ctx, time.Minute)
defer cancel()
_, err := tapv2.NewServiceClient(vppConn).TapDeleteV2(delCtx, &tapv2.TapDeleteV2{
SwIfIndex: swIfIndex,
})
if err != nil {
Expand Down

0 comments on commit e6d0f80

Please sign in to comment.