Skip to content

Fix flaky timezone test fixture (GH-18624)#21665

Open
hakre wants to merge 1 commit intophp:masterfrom
hakre:patch-20028-8.3-ext-date
Open

Fix flaky timezone test fixture (GH-18624)#21665
hakre wants to merge 1 commit intophp:masterfrom
hakre:patch-20028-8.3-ext-date

Conversation

@hakre
Copy link
Copy Markdown
Contributor

@hakre hakre commented Apr 7, 2026

As documented in RunningTests, tests have to be written to be independent of any php.ini file.

Without specifying the timezone, the var_dump() will make use of the default timezone that may not be the expected "UTC" timezone.

This renders the test-cases flaky and will make them fail if the date.timezone is different from the string "UTC".

Fix is to interpolate the timezone in the test fixture or to set date.timezone to UTC.

fix-up-of: GH-18624

As documented in [RunningTests], tests have to be written to be
independent of any php.ini file.

Without specifying the timezone, the var_dump() will make use of the
default timezone that may not be the expected "UTC" timezone.

This renders the test-cases flaky and will make them fail if the
`date.timezone` is different from the string "UTC".

Fix is to interpolate the timezone in the test fixture or to set
`date.timezone` to `UTC`.

[RunningTests]: docs/source/miscellaneous/running-tests.rst
fix-up-of: phpGH-18624
@hakre
Copy link
Copy Markdown
Contributor Author

hakre commented Apr 7, 2026

@derickr This is the ext/date part from #20035, rebased. You had approved this previously – could you take another look? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant