From 57e3712dbd9da0f91b34413fdd2b1fcd7cc3ca5e Mon Sep 17 00:00:00 2001 From: zhanghj Date: Fri, 24 Sep 2021 16:06:06 +0800 Subject: [PATCH] virtiofs: fix error report in TestVirtiofsdStart when go test running Initialize ctx with context.Background() instead of nil value. Fixes: #2718 Signed-off-by: zhanghj --- src/runtime/virtcontainers/virtiofsd_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/virtcontainers/virtiofsd_test.go b/src/runtime/virtcontainers/virtiofsd_test.go index f361f5471f..596257b7d7 100644 --- a/src/runtime/virtcontainers/virtiofsd_test.go +++ b/src/runtime/virtcontainers/virtiofsd_test.go @@ -70,7 +70,7 @@ func TestVirtiofsdStart(t *testing.T) { PID: tt.fields.PID, ctx: tt.fields.ctx, } - var ctx context.Context + ctx := context.Background() _, err := v.Start(ctx, nil) if (err != nil) != tt.wantErr { t.Errorf("virtiofsd.Start() error = %v, wantErr %v", err, tt.wantErr)