forked from mirrors/statsd_exporter
Compare commits
1 commit
master
...
mr/flaky-t
Author | SHA1 | Date | |
---|---|---|---|
|
39a8629864 |
1 changed files with 5 additions and 3 deletions
|
@ -45,8 +45,10 @@ func TestRelay_RelayLine(t *testing.T) {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const testAddr = "[::1]:1160"
|
||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
udp.SetAddr(":1160")
|
udp.SetAddr(testAddr)
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
tickerCh := make(chan time.Time)
|
tickerCh := make(chan time.Time)
|
||||||
clock.ClockInstance = &clock.Clock{
|
clock.ClockInstance = &clock.Clock{
|
||||||
|
@ -57,7 +59,7 @@ func TestRelay_RelayLine(t *testing.T) {
|
||||||
logger := log.NewNopLogger()
|
logger := log.NewNopLogger()
|
||||||
r, err := NewRelay(
|
r, err := NewRelay(
|
||||||
logger,
|
logger,
|
||||||
"localhost:1160",
|
testAddr,
|
||||||
200,
|
200,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -92,7 +94,7 @@ func TestRelay_RelayLine(t *testing.T) {
|
||||||
"statsd_exporter_relay_lines_relayed_total": float64(len(tt.args.lines)),
|
"statsd_exporter_relay_lines_relayed_total": float64(len(tt.args.lines)),
|
||||||
}
|
}
|
||||||
for metricName, expectedValue := range metricNames {
|
for metricName, expectedValue := range metricNames {
|
||||||
metric := getFloat64(metrics, metricName, prometheus.Labels{"target": "localhost:1160"})
|
metric := getFloat64(metrics, metricName, prometheus.Labels{"target": testAddr})
|
||||||
|
|
||||||
if metric == nil {
|
if metric == nil {
|
||||||
t.Fatalf("Could not find time series with first label set for metric: %s", metricName)
|
t.Fatalf("Could not find time series with first label set for metric: %s", metricName)
|
||||||
|
|
Loading…
Reference in a new issue