Skip to content

Commit

Permalink
memfs: Fix test which may error due to Windows timer resolution
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
pjbgf committed Jan 10, 2025
1 parent 56610a8 commit 36eabfe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions memfs/memory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"
"runtime"
"testing"
"time"

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

if runtime.GOOS == "windows" {
time.Sleep(20 * time.Millisecond)
}

_, err = fs.Create("/file2")
require.NoError(t, err)

Expand Down

0 comments on commit 36eabfe

Please sign in to comment.