Fix flaky timezone test fixture (GH-18624)#21665
Conversation
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
|
@iluuu1994 thank you for looking. hmm, I only now specifically about having a RFC vote for it's default value in run-tests.php (ref: "If fatal_error_backtraces defaults to 1, default value in run-tests.php" in https://wiki.php.net/rfc/error_backtraces_v2#proposed_voting_choices) for that value "0". and thinking: instead of patching individual tests the And while I just wanted to ask about the branch to PR against the change of |
|
IMO, |
add date.timezone=UTC to the INI overwrites in run-tests.php. refs: php#21665
|
closing in favor of #21729 |
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.timezoneis different from the string "UTC".Fix is to interpolate the timezone in the test fixture or to set
date.timezonetoUTC.fix-up-of: GH-18624