Skip to content

Commit

Permalink
added sleep to racy metrics test
Browse files Browse the repository at this point in the history
  • Loading branch information
neufeldtech committed Mar 10, 2022
1 parent e05247f commit 084b1f5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"reflect"
"strings"
"testing"
"time"

"github.com/Shopify/toxiproxy/v2/collectors"
"github.com/Shopify/toxiproxy/v2/stream"
Expand All @@ -31,6 +32,7 @@ func TestProxyMetricsReceivedSentBytes(t *testing.T) {
bufio.NewWriter(bytes.NewBuffer([]byte{})),
}
proxy.Toxics.StartLink(srv, "testupstream", r, w, stream.Upstream)
time.Sleep(time.Millisecond * 100)
gotMetrics := prometheusOutput(t, srv, "toxiproxy")
if !reflect.DeepEqual(gotMetrics, expectedMetrics) {
t.Fatalf("expected: %v got: %v", expectedMetrics, gotMetrics)
Expand Down

0 comments on commit 084b1f5

Please sign in to comment.