Make WordPress Core

Opened 4 years ago

Last modified 4 years ago

#51625 new defect (bug)

Date/Time test failures during DST transition

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Date/Time Keywords:
Focuses: Cc:

Description

There are some tests in Europe/London and Europe/Kiev timezones that fail exactly during the hour of DST transition, October 25th 2020, 00:00 to 01:00 (UTC):

There were 4 failures:

1) Tests_Date_Current_Time::test_should_return_correct_local_time
The dates should be equal
Failed asserting that 1603588676 matches expected 1603585076.

/var/www/tests/phpunit/includes/phpunit7/testcase.php:38
/var/www/tests/phpunit/tests/date/currentTime.php:116

2) Tests_Date_I18n::test_should_return_wp_timestamp
The dates should be equal
Failed asserting that 1603585076 matches expected 1603588676.

/var/www/tests/phpunit/includes/phpunit7/testcase.php:38
/var/www/tests/phpunit/tests/date/dateI18n.php:152

3) Tests_Date_Get_Feed_Build_Date::test_should_fall_back_to_last_post_modified
Fall back to time of last post modified with no posts
Failed asserting that false matches expected 1603588676.

/var/www/tests/phpunit/includes/phpunit7/testcase.php:38
/var/www/tests/phpunit/tests/date/getFeedBuildDate.php:67

4) Tests_Formatting_Date::test_get_gmt_from_date_string_date
The dates should be equal
Failed asserting that 1603588686 matches expected 1603585086.

/var/www/tests/phpunit/includes/phpunit7/testcase.php:38
/var/www/tests/phpunit/tests/formatting/date.php:88

https://travis-ci.com/github/WordPress/wordpress-develop/builds/192590290

To reproduce locally, just set the system date to the date and time above.

These should ideally be made less fragile. Since we already have some tests for DST specifically, perhaps these tests should use a timezone that does not observe DST.

Change History (1)

This ticket was mentioned in Slack in #core by sergey. View the logs.


4 years ago

Note: See TracTickets for help on using tickets.