chore: bump timeout on FindNodesWithoutDeserializing

This commit is contained in:
Tristan Cartledge
2024-02-13 18:14:28 +00:00
committed by quobix
parent 5ea4f2b762
commit 9d9ff8a00c

View File

@@ -4,8 +4,6 @@ import (
"context" "context"
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/vmware-labs/yaml-jsonpath/pkg/yamlpath"
"gopkg.in/yaml.v3"
"net/http" "net/http"
"net/url" "net/url"
"regexp" "regexp"
@@ -13,6 +11,9 @@ import (
"strconv" "strconv"
"strings" "strings"
"time" "time"
"github.com/vmware-labs/yaml-jsonpath/pkg/yamlpath"
"gopkg.in/yaml.v3"
) )
type Case int8 type Case int8
@@ -107,7 +108,6 @@ func FindNodesWithoutDeserializing(node *yaml.Node, jsonPath string) ([]*yaml.No
jsonPath = FixContext(jsonPath) jsonPath = FixContext(jsonPath)
path, err := yamlpath.NewPath(jsonPath) path, err := yamlpath.NewPath(jsonPath)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@@ -115,7 +115,7 @@ func FindNodesWithoutDeserializing(node *yaml.Node, jsonPath string) ([]*yaml.No
// this can spin out, to lets gatekeep it. // this can spin out, to lets gatekeep it.
done := make(chan bool) done := make(chan bool)
var results []*yaml.Node var results []*yaml.Node
timeout, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond) timeout, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond)
defer cancel() defer cancel()
go func(d chan bool) { go func(d chan bool) {
results, _ = path.Find(node) results, _ = path.Find(node)