@cryptotaxi247 / netdata-1 / commits / 24141b8bc

fix go.d/nats tests (#19284)

Ilya Mashchenko committed Dec 25, 2024 at 16:07 UTC 24141b8bcd611aa532bff8b52d0aa13e9cdbb086
2 files changed +5 -3
src/go/plugin/go.d/collector/nats/collect.go
+2 -2
@@ -77,9 +77,9 @@ func (c *Collector) collectHealthz(mx map[string]int64) error {
77
78 switch c.HealthzCheck {
79 case "js-enabled-only":
80 - req.URL.Scheme = urlQueryHealthzJsEnabledOnly
80 + req.URL.RawQuery = urlQueryHealthzJsEnabledOnly
81 case "js-server-only":
82 - req.URL.Scheme = urlQueryHealthzJsServerOnly
82 + req.URL.RawQuery = urlQueryHealthzJsServerOnly
83 }
84
85 var resp healthzResponse
src/go/plugin/go.d/collector/nats/collector_test.go
+3 -1
@@ -201,7 +201,7 @@ func TestCollector_Collect(t *testing.T) {
201 "leafz_leaf__$G_127.0.0.1_6223_num_subs": 1,
202 "leafz_leaf__$G_127.0.0.1_6223_out_bytes": 1280000,
203 "leafz_leaf__$G_127.0.0.1_6223_out_msgs": 10000,
204 - "leafz_leaf__$G_127.0.0.1_6223_rtt": 0,
204 + "leafz_leaf__$G_127.0.0.1_6223_rtt": 200,
205 "routez_route_id_1_in_bytes": 4,
206 "routez_route_id_1_in_msgs": 1,
207 "routez_route_id_1_num_subs": 1,
@@ -265,6 +265,8 @@ func TestCollector_Collect(t *testing.T) {
265
266 mx := collr.Collect(context.Background())
267
268 + require.Equal(t, test.wantMetrics, mx)
269 +
270 if len(test.wantMetrics) > 0 {
271 assert.Equal(t, test.wantNumOfCharts, len(*collr.Charts()), "want charts")
272