From 8a721eda815b4f480cb6b6e9ae2c2649e79862ec Mon Sep 17 00:00:00 2001 From: Pavol Loffay Date: Mon, 6 Apr 2020 15:36:03 +0200 Subject: [PATCH 1/2] Fix flaky client metrics test Signed-off-by: Pavol Loffay --- cmd/agent/app/reporter/client_metrics_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/agent/app/reporter/client_metrics_test.go b/cmd/agent/app/reporter/client_metrics_test.go index 345cc386773..64cfa5e542b 100644 --- a/cmd/agent/app/reporter/client_metrics_test.go +++ b/cmd/agent/app/reporter/client_metrics_test.go @@ -263,7 +263,7 @@ func TestClientMetricsReporter_Expire(t *testing.T) { if gaugeValue == int64(test.expGauge) { break } - time.Sleep(500 * time.Microsecond) + time.Sleep(5 * time.Millisecond) } assert.EqualValues(t, test.expGauge, gaugeValue) tr.assertLog(t, test.expLog, clientUUID) From 4b05deeff80792e3c8ac7fe4bf4f08667e7c160e Mon Sep 17 00:00:00 2001 From: Pavol Loffay Date: Mon, 6 Apr 2020 17:57:59 +0200 Subject: [PATCH 2/2] Update cmd/agent/app/reporter/client_metrics_test.go Co-Authored-By: Yuri Shkuro --- cmd/agent/app/reporter/client_metrics_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/agent/app/reporter/client_metrics_test.go b/cmd/agent/app/reporter/client_metrics_test.go index 64cfa5e542b..bfdfbe542e7 100644 --- a/cmd/agent/app/reporter/client_metrics_test.go +++ b/cmd/agent/app/reporter/client_metrics_test.go @@ -263,7 +263,7 @@ func TestClientMetricsReporter_Expire(t *testing.T) { if gaugeValue == int64(test.expGauge) { break } - time.Sleep(5 * time.Millisecond) + time.Sleep(1 * time.Millisecond) } assert.EqualValues(t, test.expGauge, gaugeValue) tr.assertLog(t, test.expLog, clientUUID)