mirror of
https://github.com/restic/restic.git
synced 2026-11-21 13:02:42 +00:00
Merge pull request #21902 from restic/speedup-test
Cut local test suite execution time in half
This commit is contained in:
33 files changed
+185
-75
No files matched your search
@@ -572,13 +572,7 @@ func nodeFromFile(t testing.TB, localFs fs.FS, filename string) *data.Node {
|
||||
|
||||
// sleep sleeps long enough to ensure a timestamp change.
|
||||
func sleep() {
|
||||
d := 50 * time.Millisecond
|
||||
if runtime.GOOS == "darwin" {
|
||||
// On older Darwin instances, the file system only supports one second
|
||||
// granularity.
|
||||
d = 1500 * time.Millisecond
|
||||
}
|
||||
time.Sleep(d)
|
||||
time.Sleep(5 * time.Millisecond)
|
||||
}
|
||||
|
||||
func TestFileChanged(t *testing.T) {
|
||||
@@ -754,12 +748,12 @@ func TestArchiverSaveDir(t *testing.T) {
|
||||
}{
|
||||
{
|
||||
src: TestDir{
|
||||
"targetfile": TestFile{Content: string(rtest.Random(888, 2*1024*1024+5000))},
|
||||
"targetfile": TestFile{Content: string(rtest.Random(888, 20*1024+5000))},
|
||||
},
|
||||
target: ".",
|
||||
want: TestDir{
|
||||
"targetdir": TestDir{
|
||||
"targetfile": TestFile{Content: string(rtest.Random(888, 2*1024*1024+5000))},
|
||||
"targetfile": TestFile{Content: string(rtest.Random(888, 20*1024+5000))},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -769,8 +763,8 @@ func TestArchiverSaveDir(t *testing.T) {
|
||||
"foo": TestFile{Content: "foo"},
|
||||
"emptyfile": TestFile{Content: ""},
|
||||
"bar": TestFile{Content: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"},
|
||||
"largefile": TestFile{Content: string(rtest.Random(888, 2*1024*1024+5000))},
|
||||
"largerfile": TestFile{Content: string(rtest.Random(234, 5*1024*1024+5000))},
|
||||
"largefile": TestFile{Content: string(rtest.Random(888, 1*1024*1024+5000))},
|
||||
"largerfile": TestFile{Content: string(rtest.Random(234, 3*1024*1024+5000))},
|
||||
},
|
||||
},
|
||||
target: "targetdir",
|
||||
|
||||
Reference in new issue
Block a user