From 68fc995e8d3ba047958e5cd10b20b6d723b3472f Mon Sep 17 00:00:00 2001 From: tanghuafa Date: Tue, 12 May 2020 21:52:14 +0800 Subject: [PATCH] fix --- tests/util/util.go | 1 + utils/metric/counter.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/util/util.go b/tests/util/util.go index 3dfd28f9..65e9d96a 100644 --- a/tests/util/util.go +++ b/tests/util/util.go @@ -143,6 +143,7 @@ func SendUdpMsg(addr string, msg string) (res string, err error) { return } + conn.SetReadDeadline(time.Now().Add(10 * time.Second)) buf := make([]byte, 2048) n, errRet := conn.Read(buf) if errRet != nil { diff --git a/utils/metric/counter.go b/utils/metric/counter.go index 47718b51..ae16b675 100644 --- a/utils/metric/counter.go +++ b/utils/metric/counter.go @@ -41,7 +41,7 @@ func (c *StandardCounter) Count() int32 { } func (c *StandardCounter) Inc(count int32) { - atomic.AddInt32(&c.count, int32(count)) + atomic.AddInt32(&c.count, count) } func (c *StandardCounter) Dec(count int32) {