mirror of
https://github.com/kemko/nomad.git
synced 2026-01-09 11:55:42 +03:00
Merge pull request #6771 from hashicorp/b-deflake-TestHTTP_FreshClientAllocMetrics-test
tests: deflake TestHTTP_FreshClientAllocMetrics
This commit is contained in:
@@ -91,6 +91,8 @@ func TestHTTP_FreshClientAllocMetrics(t *testing.T) {
|
||||
require.Fail("timed-out waiting for job to complete")
|
||||
})
|
||||
|
||||
nodeID := s.client.NodeID()
|
||||
|
||||
// wait for metrics to converge
|
||||
var pending, running, terminal float32 = -1.0, -1.0, -1.0
|
||||
testutil.WaitForResultRetries(100, func() (bool, error) {
|
||||
@@ -106,6 +108,13 @@ func TestHTTP_FreshClientAllocMetrics(t *testing.T) {
|
||||
|
||||
metrics := obj.(metrics.MetricsSummary)
|
||||
for _, g := range metrics.Gauges {
|
||||
|
||||
// ignore client metrics belonging to other test nodes
|
||||
// from other tests that contaminate go-metrics reporting
|
||||
if g.DisplayLabels["node_id"] != nodeID {
|
||||
continue
|
||||
}
|
||||
|
||||
if strings.HasSuffix(g.Name, "client.allocations.pending") {
|
||||
pending = g.Value
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user