mirror of https://github.com/spf13/afero.git
Merge pull request #57 from spf13/short-test-sleep
Speed up test on unix systems
This commit is contained in:
commit
49e01f227a
|
@ -2,5 +2,5 @@ language: go
|
|||
go:
|
||||
- tip
|
||||
script:
|
||||
- go test ./...
|
||||
- go test -v ./...
|
||||
- go build
|
||||
|
|
|
@ -3,6 +3,7 @@ package afero
|
|||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
@ -232,9 +233,14 @@ func TestWriteCloseTime(t *testing.T) {
|
|||
t.Error(fs.Name()+":", "Stat failed: "+err.Error())
|
||||
}
|
||||
timeBefore := fi.ModTime()
|
||||
// sorry for the delay, but we have to make sure time advances, also
|
||||
// on non Un*x systems...
|
||||
|
||||
if runtime.GOOS == "windows" {
|
||||
// sorry for the delay, but we have to make sure time advances,
|
||||
// also on non Un*x systems...
|
||||
time.Sleep(2 * time.Second)
|
||||
} else {
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
}
|
||||
|
||||
_, err = f.Write([]byte("test"))
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue