forked from mirror/afero
try to speed up test on unix systems
This commit is contained in:
parent
6a67f8a50b
commit
9d27152292
|
@ -3,6 +3,7 @@ package afero
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
@ -232,9 +233,14 @@ func TestWriteCloseTime(t *testing.T) {
|
||||||
t.Error(fs.Name()+":", "Stat failed: "+err.Error())
|
t.Error(fs.Name()+":", "Stat failed: "+err.Error())
|
||||||
}
|
}
|
||||||
timeBefore := fi.ModTime()
|
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" {
|
||||||
time.Sleep(2 * time.Second)
|
// 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"))
|
_, err = f.Write([]byte("test"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue