mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-20 07:37:38 +01:00
Merge pull request #11493 from steven-zou/fix/js_ut_case_failure
fix(js UT cases):fix the cron spec bug
This commit is contained in:
commit
5661ff937b
@ -123,13 +123,14 @@ func (suite *EnqueuerTestSuite) prepare() {
|
|||||||
now := time.Now()
|
now := time.Now()
|
||||||
minute := now.Minute()
|
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
|
// Prepare one
|
||||||
p := &Policy{
|
p := &Policy{
|
||||||
ID: "fake_policy",
|
ID: "fake_policy",
|
||||||
JobName: job.SampleJob,
|
JobName: job.SampleJob,
|
||||||
CronSpec: coreSpec,
|
CronSpec: cronSpec,
|
||||||
}
|
}
|
||||||
rawData, err := p.Serialize()
|
rawData, err := p.Serialize()
|
||||||
assert.Nil(suite.T(), err, "prepare data: nil error expected but got %s", err)
|
assert.Nil(suite.T(), err, "prepare data: nil error expected but got %s", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user