From 305978d4097615b6a72e2eac4c91d8e070288965 Mon Sep 17 00:00:00 2001 From: pmahindrakar-oss Date: Mon, 26 Sep 2022 18:58:19 +0530 Subject: [PATCH] Fixed unit tests Signed-off-by: pmahindrakar-oss --- scheduler/core/gocron_scheduler_test.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/scheduler/core/gocron_scheduler_test.go b/scheduler/core/gocron_scheduler_test.go index 320645b77..aa3e2f75c 100644 --- a/scheduler/core/gocron_scheduler_test.go +++ b/scheduler/core/gocron_scheduler_test.go @@ -129,7 +129,7 @@ func setupWithSchedules(t *testing.T, subscope string, schedules []models.Schedu func TestCalculateSnapshot(t *testing.T) { t.Run("empty snapshot", func(t *testing.T) { ctx := context.Background() - g := setup(t, "empty_snapshot") + g := setupWithSchedules(t, "empty_snapshot", nil) snapshot := g.CalculateSnapshot(ctx) assert.NotNil(t, snapshot) assert.True(t, snapshot.IsEmpty()) @@ -137,12 +137,6 @@ func TestCalculateSnapshot(t *testing.T) { t.Run("non empty snapshot", func(t *testing.T) { ctx := context.Background() g := setup(t, "non_empty_snapshot") - g.jobStore.Range(func(key, value interface{}) bool { - currTime := time.Now() - job := value.(*GoCronJob) - job.lastTime = &currTime - return true - }) snapshot := g.CalculateSnapshot(ctx) assert.NotNil(t, snapshot) assert.False(t, snapshot.IsEmpty())