mirror of https://github.com/gin-gonic/gin.git
test(path): Optimize unit test execution results (#3883)
* test(path): Add a GC recycle validation * test(path): Optimize unit test execution results * test(path): Optimize unit test execution results
This commit is contained in:
parent
ee70b30a97
commit
fd60a24ab7
|
@ -6,6 +6,7 @@
|
|||
package gin
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
|
@ -80,6 +81,10 @@ func TestPathCleanMallocs(t *testing.T) {
|
|||
t.Skip("skipping malloc count in short mode")
|
||||
}
|
||||
|
||||
if runtime.GOMAXPROCS(0) > 1 {
|
||||
t.Skip("skipping malloc count; GOMAXPROCS>1")
|
||||
}
|
||||
|
||||
for _, test := range cleanTests {
|
||||
allocs := testing.AllocsPerRun(100, func() { cleanPath(test.result) })
|
||||
assert.EqualValues(t, allocs, 0)
|
||||
|
|
Loading…
Reference in New Issue