From e6d0f80e33a28809457bd40a7f6f1857a45e1d67 Mon Sep 17 00:00:00 2001 From: Denis Tingaikin Date: Wed, 10 Jul 2024 17:55:04 +0300 Subject: [PATCH] use context with timeout for testing Signed-off-by: Denis Tingaikin --- pkg/networkservice/mechanisms/kernel/kerneltap/common.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/networkservice/mechanisms/kernel/kerneltap/common.go b/pkg/networkservice/mechanisms/kernel/kerneltap/common.go index 3282a03b..cb1085bb 100644 --- a/pkg/networkservice/mechanisms/kernel/kerneltap/common.go +++ b/pkg/networkservice/mechanisms/kernel/kerneltap/common.go @@ -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 {