[TYPO3-core] RFC #16333: Bug: Make scheduler's execution class fully testable

Marcus Krause marcus#exp2010 at t3sec.info
Wed Nov 10 19:50:31 CET 2010


Hi Oliver!


Thank you for your comments.

Oliver Klee schrieb am 11/10/2010 05:48 PM Uhr:
> Hi,
> 
> +1 by reading with the followings nits:
> 
> - Please add two tests:
>   a) that the constructor copies the timestamp from $GLOBALS['EXEC_TIME'];
>   b) that the setter sets the time

done, see attached 16333-test.diff

> 
>> -					$now = time();
>> -					$date = $now + $this->interval - (($now - $this->start) % $this->interval);
>> +					$date = $this->currentTimestamp + $this->interval - (($this->currentTimestamp - $this->start) % $this->interval);
> 
> I think this will be more readable if you keep using $now (your decision
> ...):

I'd stick to $this->currentTimestamp as this is now used allover the
class. Just a matter of consistency.

attached is v1 again for sake of completeness


> - I haven't read the scheduler code yet. Have you checked that the
> scheduler doesn't rely on the timestamps being different before and
> running after a job?

Well, a task is a running instance of a class. The CLI selects all
potential tasks by a test if a DB field (nextexecution) is equal or
older than EXEC_TIME. When a task is done, the field is newly calculated
and updated. Therefore I don't expect any problems.

By the way, this is the 4th issue regarding scheduler and all of them
are just preliminaries to fix a really annoying bug - coming up soon.


Marcus.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 16333-test.diff
Type: text/x-diff
Size: 2919 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20101110/e2c71567/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 16333_v1.diff
Type: text/x-diff
Size: 2619 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20101110/e2c71567/attachment-0001.diff>


More information about the TYPO3-team-core mailing list