From c86f0553846ff11e152628f94f8392328f48db39 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 9 Oct 2026 00:16:29 +0200 Subject: [PATCH] Give the test snapshot a creation time apart from the fake clock in every zone On the build node, in UTC, the fixture's creation time was the fake clock's own instant, so the test could not tell the list's time from the clock's. A day and a half earlier is apart from it everywhere. --- modules/zfs/cmd/zfs-tools/snapshot_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/zfs/cmd/zfs-tools/snapshot_test.go b/modules/zfs/cmd/zfs-tools/snapshot_test.go index 17b99bbd..645d5fe6 100644 --- a/modules/zfs/cmd/zfs-tools/snapshot_test.go +++ b/modules/zfs/cmd/zfs-tools/snapshot_test.go @@ -42,7 +42,7 @@ func TestTheSnapshotCommandIsFixedWordsThroughSudoWithTheNameAfterDashDash(t *te func TestASnapshotIsAnsweredFromTheListAfterwardsAndRecorded(t *testing.T) { f := withZFS(t) - snapshotting(f, takeLine, "tank/media@before-move\t1791547200\t0\t26938034880512") + snapshotting(f, takeLine, "tank/media@before-move\t1791400000\t0\t26938034880512") a, err := f.machine().TakeSnapshot(context.Background(), "tank/media", "before-move", "before moving the library", false) if err != nil { t.Fatal(err) @@ -50,7 +50,7 @@ func TestASnapshotIsAnsweredFromTheListAfterwardsAndRecorded(t *testing.T) { if !a.Done || len(a.Made) != 1 || a.Made[0].Name != "tank/media@before-move" || a.Made[0].Referenced != 26938034880512 { t.Fatalf("answer: %+v", a) } - if a.Made[0].Created != time.Unix(1791547200, 0).Local().Format(time.RFC3339) || a.Made[0].Created == f.now.Format(time.RFC3339) { + if a.Made[0].Created != time.Unix(1791400000, 0).Local().Format(time.RFC3339) || a.Made[0].Created == f.now.Format(time.RFC3339) { t.Errorf("the creation time is the list's: %s", a.Made[0].Created) } if len(a.Others) != 0 || !strings.Contains(a.Said, "No other snapshot came or went") || !strings.Contains(a.Said, "Why: before moving the library") { @@ -91,7 +91,7 @@ func TestARefusedSudoIsSaidAndRecorded(t *testing.T) { func TestAnUnrecordedActSaysSoLoudly(t *testing.T) { f := withZFS(t) - snapshotting(f, takeLine, "tank/media@before-move\t1791547200\t0\t1") + snapshotting(f, takeLine, "tank/media@before-move\t1791400000\t0\t1") f.emitErr = errors.New("the bus did not accept it") a, err := f.machine().TakeSnapshot(context.Background(), "tank/media", "before-move", "why", false) if err != nil { @@ -104,7 +104,7 @@ func TestAnUnrecordedActSaysSoLoudly(t *testing.T) { func TestAnotherSnapshotMeanwhileIsSaidNotHidden(t *testing.T) { f := withZFS(t) - snapshotting(f, takeLine, "tank/media@before-move\t1791547200\t0\t1", "tank/downloads@auto-1200\t1791547201\t0\t1") + snapshotting(f, takeLine, "tank/media@before-move\t1791400000\t0\t1", "tank/downloads@auto-1200\t1791547201\t0\t1") a, err := f.machine().TakeSnapshot(context.Background(), "tank/media", "before-move", "why", false) if err != nil { t.Fatal(err) @@ -157,7 +157,7 @@ func TestRecursiveIsRefusedWhenAChildHasTheNameAlready(t *testing.T) { } // Without recursive, only tank's own name counts. f = withZFS(t) - snapshotting(f, "sudo -n zfs snapshot -- tank@weekly", "tank@weekly\t1791547200\t0\t1") + snapshotting(f, "sudo -n zfs snapshot -- tank@weekly", "tank@weekly\t1791400000\t0\t1") if a, err := f.machine().TakeSnapshot(context.Background(), "tank", "weekly", "why", false); err != nil || len(a.Made) != 1 { t.Errorf("tank@weekly alone: %v %+v", err, a) }