Skip to content

Commit e43817a

Browse files
committed
add timeout to node test
1 parent 4341dad commit e43817a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

collector/nodes_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"net/url"
2323
"strings"
2424
"testing"
25+
"time"
2526

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

0 commit comments

Comments
 (0)