-
Bug
-
Resolution: Fixed
-
Minor
-
2.3.2, 2.4
-
None
-
MOODLE_23_STABLE, MOODLE_24_STABLE
-
MOODLE_23_STABLE
-
This is a followup of MDL-28531.
it has been detected that the tests added to verify the behavior of calculate_next_automated_backup() are failing "too much".
For example, since some days ago, with the next DST change for America/New_York coming next Sunday, a bunch of tests are failing. Same applies to the Europe/Brussels one 1 week ago.
The main reason for those longs periods getting failed tests is that the calculation of the $dst variable is performed for time() and that causes next executions scheduled to return results with DST changes applied for long periods (up to 'next Monday 18:00:00' in some cases.
So one immediate solution to REDUCE (not to fix them forever) is to, simply, change the $dst calculation, from:
$dst = date('I');
|
to:
$dst = date('I', $now);
|
That way, the failing window is reduced a lot and only when executed "around" the DST changes (some hours before to some hours after) the unit tests will fail.
The proposed patch applies that change in the 4 places susceptible to get a "reduced" failing window, with explanations about when the tests are supposed to continue failing.
Ciao