While working on a patch for MDL-73859, we realised there was a pre-existing bug (unrelated to the behat test) that can be reproduced consistently under the following circumstances:
- Running the "Highlight first week", changing "##yesterday##" to "##today##" and
- The day for the current date wherever you run the behat test and Perth time is different (for instance, all the jobs launched after 17:00 EU (00:00 AU) will fail).
The calculation of the "This week" badge is done in the get_section_dates() method in course/format/weeks/lib.php, and the calculation of the start course date is tricky (because it also introduces the user dates to the equation).
Ideally, we should really calculate them properly, say:
- week one begins on course->starttime and ends on +7 days.
- week2 begins on +7 days and ends on +7 days
- ...
And then, just see in which of the intervales the current unix-time falls.
This issue is to investigate the bug and check if it's possible to avoid mixing timezones.
- Discovered while testing
-
MDL-73859 Random goutte failure in "Highlight first week" scenario
-
- Closed
-