From cd6f4153e05910a5be486b21f41201bdce58f63a Mon Sep 17 00:00:00 2001 From: carlory Date: Thu, 14 Nov 2024 16:44:04 +0800 Subject: [PATCH] Fix a bug in framework.IgnoreNotFound where it will panic when a function type's final input parameter is a "..." parameter. --- test/e2e/framework/ginkgowrapper.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/e2e/framework/ginkgowrapper.go b/test/e2e/framework/ginkgowrapper.go index 8517e4b5182..d47939d21f1 100644 --- a/test/e2e/framework/ginkgowrapper.go +++ b/test/e2e/framework/ginkgowrapper.go @@ -97,7 +97,12 @@ func IgnoreNotFound(in any) any { inType := reflect.TypeOf(in) inValue := reflect.ValueOf(in) return reflect.MakeFunc(inType, func(args []reflect.Value) []reflect.Value { - out := inValue.Call(args) + var out []reflect.Value + if inType.IsVariadic() { + out = inValue.CallSlice(args) + } else { + out = inValue.Call(args) + } if len(out) > 0 { lastValue := out[len(out)-1] last := lastValue.Interface()