1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-09 00:00:02 +01:00

Set "fake" PID on Windows to larger value.

Since Windows cannot do SIGHUP signals, we need to make sure the process ID doesn't exist for the tests to succeed.
This commit is contained in:
klauspost 2015-08-13 14:12:18 +02:00
parent a260e82e6a
commit cc805b9325

View file

@ -124,7 +124,7 @@ var staleLockTests = []struct {
{
timestamp: time.Now(),
stale: true,
pid: os.Getpid() + 500,
pid: os.Getpid() + 500000,
},
}
@ -158,7 +158,7 @@ func TestLockWithStaleLock(t *testing.T) {
id2, err := createFakeLock(repo, time.Now().Add(-time.Minute), os.Getpid())
OK(t, err)
id3, err := createFakeLock(repo, time.Now().Add(-time.Minute), os.Getpid()+500)
id3, err := createFakeLock(repo, time.Now().Add(-time.Minute), os.Getpid()+500000)
OK(t, err)
OK(t, restic.RemoveStaleLocks(repo))