mirror of
https://github.com/restic/restic.git
synced 2024-12-23 00:07:25 +00:00
internal/cache: Concurrent use of cache not working on Windows
This commit is contained in:
parent
b48766d7b8
commit
1220fe9650
1 changed files with 13 additions and 0 deletions
13
internal/cache/file_test.go
vendored
13
internal/cache/file_test.go
vendored
|
@ -6,6 +6,7 @@ import (
|
|||
"io/ioutil"
|
||||
"math/rand"
|
||||
"os"
|
||||
"runtime"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
|
@ -204,7 +205,19 @@ func TestFileLoad(t *testing.T) {
|
|||
}
|
||||
|
||||
// Simulate multiple processes writing to a cache, using goroutines.
|
||||
//
|
||||
// The possibility of sharing a cache between multiple concurrent restic
|
||||
// processes isn't guaranteed in the docs and doesn't always work on Windows
|
||||
// due to the Go runtime opening files without FILE_SHARE_DELETE, hence the
|
||||
// check on GOOS. This is considered a "nice to have" on POSIX, for now.
|
||||
//
|
||||
// See https://devblogs.microsoft.com/oldnewthing/20211022-00/?p=105822
|
||||
// for hints on how to fix this properly.
|
||||
func TestFileSaveConcurrent(t *testing.T) {
|
||||
if runtime.GOOS == "windows" {
|
||||
t.Skip("may not work due to FILE_SHARE_DELETE issue")
|
||||
}
|
||||
|
||||
const nproc = 40
|
||||
|
||||
c, cleanup := TestNewCache(t)
|
||||
|
|
Loading…
Reference in a new issue