forked from TrueCloudLab/restic
lock: use mem backend for locking tests
This hopefully fixes the timing related test failures which appear to be caused by very slow fsync calls.
This commit is contained in:
parent
6a436d731d
commit
399f8e84a1
1 changed files with 8 additions and 0 deletions
|
@ -8,6 +8,8 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/restic/restic/internal/backend/location"
|
||||
"github.com/restic/restic/internal/backend/mem"
|
||||
"github.com/restic/restic/internal/repository"
|
||||
"github.com/restic/restic/internal/restic"
|
||||
"github.com/restic/restic/internal/test"
|
||||
|
@ -15,6 +17,12 @@ import (
|
|||
|
||||
func openLockTestRepo(t *testing.T, wrapper backendWrapper) (*repository.Repository, func(), *testEnvironment) {
|
||||
env, cleanup := withTestEnvironment(t)
|
||||
|
||||
reg := location.NewRegistry()
|
||||
reg.Register(mem.NewFactory())
|
||||
env.gopts.backends = reg
|
||||
env.gopts.Repo = "mem:"
|
||||
|
||||
if wrapper != nil {
|
||||
env.gopts.backendTestHook = wrapper
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue