This is an archive of the discontinued LLVM Phabricator instance.

[elfabi] Fix tests which failed on different timezones
ClosedPublic

Authored by haowei on Jan 28 2021, 2:29 PM.

Details

Summary

This patch fixes elfabi tests on machines using a GMT+X timezone settings.
The discussion of the issue can be seen in D92902.

Diff Detail

Event Timeline

haowei requested review of this revision.Jan 28 2021, 2:29 PM
haowei created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 28 2021, 2:29 PM

jhenderson mentions a different solution in the discussion on D92902. Maybe that's better?

Yes, I'd recommend we use the solution that has been used elsewhere, as that is known to work (I assume, since it's been like that for a while!).

I've subscribed a colleague who has looked at these timezone issues in the past, and was involved in the llvm-ar work, so might have some further insight.

haowei updated this revision to Diff 320182.Jan 29 2021, 11:35 AM

Added env TZ=GMT to force use GMT timezone. Not quite sure if it works on Windows. The default cmd.exe does not seem to support env VAR=VAL pattern to set environment variables.

Added env TZ=GMT to force use GMT timezone. Not quite sure if it works on Windows. The default cmd.exe does not seem to support env VAR=VAL pattern to set environment variables.

It should work, but I'll confirm later today.

hans added a comment.Feb 1 2021, 2:10 AM

Not quite sure if it works on Windows. The default cmd.exe does not seem to support env VAR=VAL pattern to set environment variables.

I think the env VAR=VAL pattern is handled by lit, so it should work on Windows too.

jhenderson accepted this revision.Feb 1 2021, 2:56 AM

LGTM - the tests pass on my Windows machine (admittedly it's a GMT timezone machine, but the env part of the link doesn't cause failures at least).

This revision is now accepted and ready to land.Feb 1 2021, 2:56 AM
This revision was landed with ongoing or failed builds.Feb 1 2021, 10:59 AM
This revision was automatically updated to reflect the committed changes.
hans added a comment.Feb 2 2021, 1:01 AM

Thanks! I've requested a merge for the LLVM 12 release in https://bugs.llvm.org/show_bug.cgi?id=48917