From 59ad0679d00ad3728188268bf0dafb52f34fda64 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 12 Jul 2021 17:15:57 -0700 Subject: [PATCH] test: disable timing dependent bandwidth test unless we're on linux --- metrics/bandwidth_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/metrics/bandwidth_test.go b/metrics/bandwidth_test.go index 9f74057..685850d 100644 --- a/metrics/bandwidth_test.go +++ b/metrics/bandwidth_test.go @@ -3,6 +3,7 @@ package metrics import ( "fmt" "math" + "runtime" "sync" "testing" "time" @@ -135,6 +136,10 @@ func TestBandwidthCounter(t *testing.T) { } func TestResetBandwidthCounter(t *testing.T) { + if runtime.GOOS != "linux" { + // Specifically, it fails on MacOS because we need a high precision timer. + t.Skip("this test is highly timing dependent and only passes reliably on Linux") + } bwc := NewBandwidthCounter() p := peer.ID("peer-0")