Fix intermittent test failure
(cherry picked from commit 2c828b23df)
This commit is contained in:
Timothy Bish 2016-11-21 12:37:52 -05:00
parent 3903ea08ab
commit 3597fd9614
2 changed files with 5 additions and 4 deletions

View File

@ -223,7 +223,8 @@ public class InMemoryJobScheduler implements JobScheduler {
long startTime = System.currentTimeMillis();
long executionTime = 0;
// round startTime - so we can schedule more jobs at the same time
startTime = ((startTime + 500) / 1000) * 1000;
startTime = ((startTime + 500) / 500) * 500;
if (cronEntry != null && cronEntry.length() > 0) {
try {
executionTime = CronParser.getNextScheduledTime(cronEntry, startTime);

View File

@ -227,9 +227,9 @@ public class JobSchedulerImpl extends ServiceSupport implements Runnable, JobSch
private void doSchedule(final String jobId, final ByteSequence payload, final String cronEntry, long delay, long period, int repeat) throws IOException {
long startTime = System.currentTimeMillis();
// round startTime - so we can schedule more jobs
// at the same time
startTime = ((startTime + 500) / 1000) * 1000;
// round startTime - so we can schedule more jobs at the same time
startTime = ((startTime + 500) / 500) * 500;
long time = 0;
if (cronEntry != null && cronEntry.length() > 0) {
try {