test(inputs.mcrouter): add eventually to pause for metrics (#12074)

This commit is contained in:
Joshua Powers 2022-10-21 07:27:22 -06:00 committed by GitHub
parent 76d7a95400
commit d04e0f2b32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 61 deletions

View File

@ -5,6 +5,7 @@ import (
"fmt"
"strings"
"testing"
"time"
"github.com/docker/go-connections/nat"
"github.com/stretchr/testify/require"
@ -72,77 +73,22 @@ func TestMcrouterGeneratesMetricsIntegration(t *testing.T) {
var acc testutil.Accumulator
err = acc.GatherError(m.Gather)
require.NoError(t, err)
// wait for the uptime stat to show up
require.Eventually(t, func() bool {
err = acc.GatherError(m.Gather)
require.NoError(t, err)
return acc.HasInt64Field("mcrouter", "uptime")
}, 5*time.Second, 10*time.Millisecond)
intMetrics := []string{
"uptime",
// "num_servers",
// "num_servers_new",
// "num_servers_up",
// "num_servers_down",
// "num_servers_closed",
// "num_clients",
// "num_suspect_servers",
// "destination_batches_sum",
// "destination_requests_sum",
// "outstanding_route_get_reqs_queued",
// "outstanding_route_update_reqs_queued",
// "outstanding_route_get_avg_queue_size",
// "outstanding_route_update_avg_queue_size",
// "outstanding_route_get_avg_wait_time_sec",
// "outstanding_route_update_avg_wait_time_sec",
// "retrans_closed_connections",
// "destination_pending_reqs",
// "destination_inflight_reqs",
// "destination_batch_size",
// "asynclog_requests",
// "proxy_reqs_processing",
// "proxy_reqs_waiting",
// "client_queue_notify_period",
// "ps_num_minor_faults",
// "ps_num_major_faults",
// "ps_vsize",
// "ps_rss",
// "fibers_allocated",
// "fibers_pool_size",
// "fibers_stack_high_watermark",
// "successful_client_connections",
// "duration_us",
// "destination_max_pending_reqs",
// "destination_max_inflight_reqs",
// "retrans_per_kbyte_max",
// "cmd_get_count",
// "cmd_delete_out",
// "cmd_lease_get",
"cmd_set",
// "cmd_get_out_all",
// "cmd_get_out",
// "cmd_lease_set_count",
// "cmd_other_out_all",
// "cmd_lease_get_out",
// "cmd_set_count",
// "cmd_lease_set_out",
// "cmd_delete_count",
// "cmd_other",
// "cmd_delete",
"cmd_get",
// "cmd_lease_set",
// "cmd_set_out",
// "cmd_lease_get_count",
// "cmd_other_out",
// "cmd_lease_get_out_all",
// "cmd_set_out_all",
// "cmd_other_count",
// "cmd_delete_out_all",
// "cmd_lease_set_out_all"
}
floatMetrics := []string{
"rusage_system",
"rusage_user",
// "ps_user_time_sec",
// "ps_system_time_sec",
}
for _, metric := range intMetrics {