Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly set $ENV{TZ} in three test files. #622

Closed

Conversation

jkeenan
Copy link

@jkeenan jkeenan commented May 19, 2018

As per usage in t/plugins/nextrelease.t.

When testing Build::Zilla in a FreeBSD-11 virtual machine, failures in
three test files were encountered. In each case, the failure occurred
when '$tzil->build;' was called in a block where the file being
processed contained non-ASCII text. In each case, an exception was
thrown whose text begins: "Cannot determine local time zone". This
message is believed to come from DateTime::TimeZone::Local.
(https://grep.metacpan.org/search?qci=&q=Cannot%20determine%20local%20time%20zone&qft=&qd=DateTime-TimeZone&f=lib%2FDateTime%2FTimeZone%2FLocal.pm)

For: #586

As per usage in t/plugins/nextrelease.t.

When testing Build::Zilla in a FreeBSD-11 virtual machine, failures in
three test files were encountered.  In each case, the failure occurred
when '$tzil->build;' was called in a block where the file being
processed contained non-ASCII text.  In each case, an exception was
thrown whose text begins: "Cannot determine local time zone".  This
message is believed to come from DateTime::TimeZone::Local.
(https://grep.metacpan.org/search?qci=&q=Cannot%20determine%20local%20time%20zone&qft=&qd=DateTime-TimeZone&f=lib%2FDateTime%2FTimeZone%2FLocal.pm)

For: rjbs#586
@ap
Copy link

ap commented May 20, 2018

I get the same DateTime::TimeZone::Local exception with TZ set to America/New_York. Setting it to Etc/GMT or Etc/UTC works for me.

@rjbs
Copy link
Owner

rjbs commented Jan 25, 2020

I am happy to apply something but this feels a bit "kick it until it works."

Perhaps a better change will be to make all DZ tests set TZ unless DateTime is able to detect the time correctly. Thoughts?

@jkeenan
Copy link
Author

jkeenan commented Jan 25, 2020

I am happy to apply something but this feels a bit "kick it until it works."

Perhaps a better change will be to make all DZ tests set TZ unless DateTime is able to detect the time correctly. Thoughts?

I have never looked into the code in the Dist::Zilla test suite, but I suspect the number of files in that suite is large -- which implies changes in more than just 3 files.

Also, how would you determine that DateTime is unable to detect the time correctly?

Thank you very much.
Jim Keenan

@karenetheridge
Copy link
Contributor

I have never looked into the code in the Dist::Zilla test suite, but I suspect the number of files in that suite is large -- which implies changes in more than just 3 files.

Not if it was done in Dist::Zilla::Tester.

@ap
Copy link

ap commented Jan 25, 2020

Thoughts?

Sounds reasonable.

@rjbs
Copy link
Owner

rjbs commented Jan 26, 2020

@ap Do you still see this problem in the wild? Jim says he doesn't on his VM. If so, does #649 address it?

@ap
Copy link

ap commented Jan 27, 2020

I can no longer reproduce this problem just by attempting to install Dist::Zilla. Not sure why. But I verified the patch anyway (see the PR for details) because recent DateTime::TimeZone versions say you should be doing this regardless.

@rjbs
Copy link
Owner

rjbs commented Jun 7, 2020

Should've been fixed in v6.015

@rjbs rjbs closed this Jun 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants