From 3804bc7493711782d022164f9dc95b8e1c79a700 Mon Sep 17 00:00:00 2001 From: Klaus Post Date: Fri, 14 Aug 2015 15:19:45 +0200 Subject: [PATCH] Use bigger offset in test to avoid random test failures. Since Windows cannot to a SIGHUP test to check if a process is live, the test will fail because the lock isn't detected as stale if a process with that ID exists. Process IDs are re-used agressively on Windows, so add 500000 makes the test extremely unlikely (if not impossible) to fail. --- lock_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lock_test.go b/lock_test.go index a2b5cb2d3..c07abb239 100644 --- a/lock_test.go +++ b/lock_test.go @@ -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))