Skip to content

Commit 36eabfe

Browse files
committed
memfs: Fix test which may error due to Windows timer resolution
More information can be found on upstream documentation: https://github.com/golang/go/blob/7255b949202bb752b6525aa24cb636ceaf24e4d1/src/time/time.go#L85-L90 Signed-off-by: Paulo Gomes <[email protected]>
1 parent 56610a8 commit 36eabfe

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

memfs/memory_test.go

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"os"
77
"runtime"
88
"testing"
9+
"time"
910

1011
"github.com/go-git/go-billy/v5"
1112
"github.com/go-git/go-billy/v5/util"
@@ -34,6 +35,10 @@ func TestModTime(t *testing.T) {
3435
_, err := fs.Create("/file1")
3536
require.NoError(t, err)
3637

38+
if runtime.GOOS == "windows" {
39+
time.Sleep(20 * time.Millisecond)
40+
}
41+
3742
_, err = fs.Create("/file2")
3843
require.NoError(t, err)
3944

0 commit comments

Comments
 (0)