diff --git a/strutil/random_test.go b/strutil/random_test.go index 052ddb47a..8e74f37a9 100644 --- a/strutil/random_test.go +++ b/strutil/random_test.go @@ -4,7 +4,6 @@ import ( "encoding/hex" "fmt" "math/rand" - "runtime" "testing" "time" @@ -27,12 +26,9 @@ func TestRandomCharsV2(t *testing.T) { fmt.Println(str) assert.Len(t, str, 6) keyMp[str] = true + time.Sleep(time.Microsecond * 10) } - if runtime.GOOS == "windows" { - t.Skip("skip test unique on windows") - return - } assert.Len(t, keyMp, 10) } @@ -45,12 +41,9 @@ func TestRandomCharsV2_issues121(t *testing.T) { fmt.Println(str) assert.Len(t, str, 32) keyMp[str] = true + time.Sleep(time.Microsecond * 10) } - if runtime.GOOS == "windows" { - t.Skip("skip test unique on windows") - return - } assert.Len(t, keyMp, 10) } @@ -63,12 +56,9 @@ func TestRandomCharsV3(t *testing.T) { fmt.Println(str) assert.Len(t, str, 4) keyMp[str] = true + time.Sleep(time.Microsecond * 10) } - if runtime.GOOS == "windows" { - t.Skip("skip test unique on windows") - return - } assert.Len(t, keyMp, size) } @@ -81,15 +71,12 @@ func TestRandWithTpl(t *testing.T) { fmt.Println(str) assert.Len(t, str, 4) keyMp[str] = true + time.Sleep(time.Microsecond * 10) } assert.NotEmpty(t, strutil.RandWithTpl(8, "")) assert.NotEmpty(t, strutil.RandWithTpl(8, strutil.AlphaBet1)) - if runtime.GOOS == "windows" { - t.Skip("skip test unique on windows") - return - } assert.Len(t, keyMp, size) }