From 045aa57adea688596f3ac3ea639901d2a50b90fb Mon Sep 17 00:00:00 2001 From: Swapnil Mhamane Date: Fri, 27 Sep 2019 12:02:21 +0530 Subject: [PATCH] Apply suggestions from code review Co-Authored-By: Shreyas Rao <42259948+shreyas-s-rao@users.noreply.github.com> Signed-off-by: Swapnil Mhamane --- Makefile | 2 +- pkg/snapshot/snapshotter/snapshotter.go | 2 +- pkg/snapshot/snapshotter/snapshotter_test.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 268d0e213..d53ab73c2 100644 --- a/Makefile +++ b/Makefile @@ -61,7 +61,7 @@ check: .PHONY: test test: - @env COVER=true .ci/unit_test + .ci/unit_test .PHONY: perf-regression-test perf-regression-test: diff --git a/pkg/snapshot/snapshotter/snapshotter.go b/pkg/snapshot/snapshotter/snapshotter.go index d6255fb4b..d98331c01 100644 --- a/pkg/snapshot/snapshotter/snapshotter.go +++ b/pkg/snapshot/snapshotter/snapshotter.go @@ -161,7 +161,7 @@ func (ssr *Snapshotter) TriggerDeltaSnapshot() error { return fmt.Errorf("snapshotter is not active") } if ssr.config.deltaSnapshotInterval < deltaSnapshotIntervalThreshold { - return fmt.Errorf("Found delta snapshot interval %s less than 1 second. Delta snapshotting is disabled. ", ssr.config.deltaSnapshotInterval) + return fmt.Errorf("Found delta snapshot interval %s less than %v. Delta snapshotting is disabled. ", ssr.config.deltaSnapshotInterval, time.Duration(deltaSnapshotIntervalThreshold)) } ssr.logger.Info("Triggering out of schedule delta snapshot...") ssr.deltaSnapshotReqCh <- emptyStruct diff --git a/pkg/snapshot/snapshotter/snapshotter_test.go b/pkg/snapshot/snapshotter/snapshotter_test.go index 5c8f44123..f6cd2c286 100644 --- a/pkg/snapshot/snapshotter/snapshotter_test.go +++ b/pkg/snapshot/snapshotter/snapshotter_test.go @@ -285,7 +285,7 @@ var _ = Describe("Snapshotter", func() { } }) - It("should fail on triggering out-of-schedule full snapshot", func() { + It("should fail on triggering out-of-schedule delta snapshot", func() { store, err = snapstore.GetSnapstore(&snapstore.Config{Container: path.Join(outputDir, "snapshotter_4.bkp")}) Expect(err).ShouldNot(HaveOccurred()) tlsConfig := etcdutil.NewTLSConfig( @@ -339,7 +339,7 @@ var _ = Describe("Snapshotter", func() { etcdUsername, etcdPassword) snapshotterConfig, err := NewSnapshotterConfig( - fmt.Sprintf("59 %d * * *", currentHour+1), // This make sure that full snapshot timer doesn't trigger full snapshot. + fmt.Sprintf("59 %d * * *", (currentHour+1)%24), // This make sure that full snapshot timer doesn't trigger full snapshot. store, maxBackups, DefaultDeltaSnapMemoryLimit,