Skip to content

Commit

Permalink
add timeout to node test
Browse files Browse the repository at this point in the history
Signed-off-by: trk-bxn <[email protected]>
  • Loading branch information
trk-bxn committed Feb 16, 2022
1 parent 510ace6 commit 8f7814b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion collector/nodes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"net/url"
"strings"
"testing"
"time"

"github.com/go-kit/log"
)
Expand Down Expand Up @@ -59,7 +60,7 @@ func TestNodesStats(t *testing.T) {
t.Fatalf("Failed to parse URL: %s", err)
}
u.User = url.UserPassword("elastic", "changeme")
c := NewNodes(log.NewNopLogger(), http.DefaultClient, u, true, "_local")
c := NewNodes(log.NewNopLogger(), http.DefaultClient, u, true, "_local", time.Duration(5))
nsr, err := c.fetchAndDecodeNodeStats()
if err != nil {
t.Fatalf("Failed to fetch or decode node stats: %s", err)
Expand Down

0 comments on commit 8f7814b

Please sign in to comment.