From 59f14dff9800be1e2a433cc0b59c648e9ec28bb2 Mon Sep 17 00:00:00 2001 From: Steven Zou Date: Wed, 8 Apr 2020 11:26:13 +0800 Subject: [PATCH] fix(js UT cases):fix the cron spec bug - eliminate the time of cron spec overflow issue in the UT case Signed-off-by: Steven Zou --- src/jobservice/period/enqueuer_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/jobservice/period/enqueuer_test.go b/src/jobservice/period/enqueuer_test.go index d2f0d3751..fb291544d 100644 --- a/src/jobservice/period/enqueuer_test.go +++ b/src/jobservice/period/enqueuer_test.go @@ -123,13 +123,14 @@ func (suite *EnqueuerTestSuite) prepare() { now := time.Now() minute := now.Minute() - coreSpec := fmt.Sprintf("0-59 %d-%d * * * *", minute, minute+2) + // Make sure we at least schedule jobs in the 3 minutes cycle + cronSpec := fmt.Sprintf("0-59 %d,%d,%d * * * *", minute, (minute+1)%60, (minute+2)%60) // Prepare one p := &Policy{ ID: "fake_policy", JobName: job.SampleJob, - CronSpec: coreSpec, + CronSpec: cronSpec, } rawData, err := p.Serialize() assert.Nil(suite.T(), err, "prepare data: nil error expected but got %s", err)