Sleep for one millisecond in the handler because the Latency will return 0s sometimes and the test will fail

This commit is contained in:
mstmdev 2022-03-24 15:45:14 +08:00
parent 865fd560fc
commit 10cbf7a42d

View File

@ -208,6 +208,7 @@ func TestLoggerWithConfigFormatting(t *testing.T) {
// set dummy ClientIP // set dummy ClientIP
c.Request.Header.Set("X-Forwarded-For", "20.20.20.20") c.Request.Header.Set("X-Forwarded-For", "20.20.20.20")
gotKeys = c.Keys gotKeys = c.Keys
time.Sleep(time.Millisecond)
}) })
PerformRequest(router, "GET", "/example?a=100") PerformRequest(router, "GET", "/example?a=100")