diff --git a/pkg/model/watchdog_options.go b/pkg/model/watchdog_options.go index cb21b019e..100d07f6e 100644 --- a/pkg/model/watchdog_options.go +++ b/pkg/model/watchdog_options.go @@ -4,7 +4,10 @@ import ( "time" ) -const DefaultWatchdogInterval = 500 * time.Millisecond +const ( + DefaultWatchdogInterval = 500 * time.Millisecond + DefaultMemoryReclaimerThreshold = 0.80 +) // WatchDogOptions contains all configuration for the WatchDog type WatchDogOptions struct { @@ -112,7 +115,7 @@ func DefaultWatchDogOptions() *WatchDogOptions { idleCheck: false, lruLimit: 0, memoryReclaimerEnabled: false, - memoryReclaimerThreshold: 0.80, + memoryReclaimerThreshold: DefaultMemoryReclaimerThreshold, } } diff --git a/pkg/model/watchdog_test.go b/pkg/model/watchdog_test.go index da25bdf4d..81085907a 100644 --- a/pkg/model/watchdog_test.go +++ b/pkg/model/watchdog_test.go @@ -107,7 +107,7 @@ var _ = Describe("WatchDog", func() { model.WithProcessManager(pm), ) _, threshold := wd.GetMemoryReclaimerSettings() - Expect(threshold).To(Equal(0.95)) // default + Expect(threshold).To(Equal(model.DefaultMemoryReclaimerThreshold)) }) It("should allow updating memory reclaimer settings dynamically", func() { @@ -318,7 +318,7 @@ var _ = Describe("WatchDog", func() { enabled, threshold := wd.GetMemoryReclaimerSettings() Expect(enabled).To(BeFalse()) - Expect(threshold).To(Equal(0.95)) + Expect(threshold).To(Equal(model.DefaultMemoryReclaimerThreshold)) }) It("should allow combining multiple options", func() {