From db20c0b8d005694ef6e57e6985b5f971545cfef1 Mon Sep 17 00:00:00 2001 From: Vladimir Rusinov Date: Tue, 13 Aug 2019 22:25:00 +0100 Subject: [PATCH] Ignore username difference in TestMetadataChanged. In some (rare) cases "fake" UID 51234 may exist in a system running a test. When this is the case, `cmp.Equal(want, node3)` will fail based on difference between empty string and an actual username present in a system. Fixes github issue #2372 --- internal/archiver/archiver_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/archiver/archiver_test.go b/internal/archiver/archiver_test.go index 3335d3cbb..596d1ecc5 100644 --- a/internal/archiver/archiver_test.go +++ b/internal/archiver/archiver_test.go @@ -2085,6 +2085,10 @@ func TestMetadataChanged(t *testing.T) { // make another snapshot snapshotID, node3 := snapshot(t, repo, fs, snapshotID, "testfile") + // Override username and group to empty string - in case underlying system has user with UID 51234 + // See https://github.com/restic/restic/issues/2372 + node3.User = "" + node3.Group = "" // make sure that metadata was recorded successfully if !cmp.Equal(want, node3) {