From 10cbf7a42d705894061d21e7aee0b9dbd461af3a Mon Sep 17 00:00:00 2001 From: mstmdev Date: Thu, 24 Mar 2022 15:45:14 +0800 Subject: [PATCH] Sleep for one millisecond in the handler because the `Latency` will return `0s` sometimes and the test will fail --- logger_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/logger_test.go b/logger_test.go index da1b654e..b7049988 100644 --- a/logger_test.go +++ b/logger_test.go @@ -208,6 +208,7 @@ func TestLoggerWithConfigFormatting(t *testing.T) { // set dummy ClientIP c.Request.Header.Set("X-Forwarded-For", "20.20.20.20") gotKeys = c.Keys + time.Sleep(time.Millisecond) }) PerformRequest(router, "GET", "/example?a=100")