I've been scratching my head over this one for a couple hours now, I've drafted in co-workers and we are all lost. This could be a case of too much coffee from the new espresso machine, or the fact it's Friday... We're not sure!
I have the following method:
private void calcuateEstimatedExecutionTimesForDueJobs(List<TestJob> dueJobs)
{
DateTime rollingTime = DatabaseConnection.getNow();
foreach (TestJob job in dueJobs)
{
job.setEstimatedStart(rollingTime);
double estimatedRuntime = job.getEstimatedRuntime();
rollingTime = rollingTime.AddSeconds(estimatedRuntime);
job.setEstimatedFinish(rollingTime);
}
}
The intention is to process a list of "TestJobs" which our app is queued to deliver. Our TestJob kindly knows how long it will "probably" take to run so I hope to use this information here to predict the "Start" & "Finish" times of each TestJob.
Unfortunately, rollingTime is never altered. Although job.getEstimatedRuntime() always returns a positive double, calling AddSeconds() on the current TestJob and passing this value has no effect.
Is there a bug in my code, or something more sinister?