diff --git a/command_test.go b/command_test.go
index 165826d1..54d3370d 100644
--- a/command_test.go
+++ b/command_test.go
@@ -2926,8 +2926,7 @@ func TestHelpFuncExecuted(t *testing.T) {
 	helpText := "Long description"
 
 	// Create a context that will be unique, not just the background context
-	executionCtx, cancel := context.WithCancel(context.Background())
-	defer cancel()
+	executionCtx := context.WithValue(context.Background(), "testKey", "123")
 
 	child := &Command{Use: "child", Run: emptyRun}
 	child.SetHelpFunc(func(cmd *Command, args []string) {