RESOLVED FIXED 65877
SVNTest.test_svn_apply depends on the timezone of the computer executing the test
https://bugs.webkit.org/show_bug.cgi?id=65877
Summary SVNTest.test_svn_apply depends on the timezone of the computer executing the ...
jochen
Reported 2011-08-08 14:24:22 PDT
The test webkitpy.common.checkout.scm.scm_unittest.SVNTest.test_svn_apply depends on the timezone to execute correctly. It compares the modifications to ChangeLogs by svn-apply (which sets the date in PST8PDT http://trac.webkit.org/browser/trunk/Tools/Scripts/VCSUtils.pm#L1364) to the current local date. If the computer is not on the same day as the current date in PST8PDT, the test fails
Attachments
Patch (2.20 KB, patch)
2011-08-12 06:30 PDT, jochen
no flags
Patch (2.63 KB, patch)
2011-08-16 08:27 PDT, jochen
no flags
jochen
Comment 1 2011-08-12 06:30:01 PDT
jochen
Comment 2 2011-08-12 06:30:54 PDT
Comment on attachment 103766 [details] Patch just so my nice patch isn't lost :)
Eric Seidel (no email)
Comment 3 2011-08-12 09:25:16 PDT
Comment on attachment 103766 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=103766&action=review > Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py:560 > + if hasattr(time, 'tzset'): > + has_tz = 'TZ' in os.environ > + old_tz = os.environ.get('TZ', '') > + os.environ['TZ'] = 'PST8PDT' > + time.tzset() I mean, we could make this less ugly by using with and an object. We'd have to be careful to do it so it works on Python 2.5. But something like the following: with TimezoneOverride('PST8PDT'): changelog_entry = changelog_entry.replace(....) class TimezoneOverride(object): def __init__(self, timezone_string): self.timezone_string = timezone_string def __enter__(self) // All the gunkto set up the timezone. def __exit__(self,type, value, traceback): // teardown. It doesn't get rid of the ugly code, but at least it puts it in a place we can clean it up later if wefigure out how to.
jochen
Comment 4 2011-08-16 08:27:53 PDT
jochen
Comment 5 2011-08-16 08:28:40 PDT
(In reply to comment #3) > (From update of attachment 103766 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=103766&action=review > > > Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py:560 > > + if hasattr(time, 'tzset'): > > + has_tz = 'TZ' in os.environ > > + old_tz = os.environ.get('TZ', '') > > + os.environ['TZ'] = 'PST8PDT' > > + time.tzset() > > I mean, we could make this less ugly by using with and an object. We'd have to be careful to do it so it works on Python 2.5. But something like the following: > > with TimezoneOverride('PST8PDT'): > changelog_entry = changelog_entry.replace(....) > > class TimezoneOverride(object): > def __init__(self, timezone_string): > self.timezone_string = timezone_string > > def __enter__(self) > // All the gunkto set up the timezone. > > def __exit__(self,type, value, traceback): > // teardown. > > It doesn't get rid of the ugly code, but at least it puts it in a place we can clean it up later if wefigure out how to. Done the necessary magic to get the with statement for python 2.5 was already part of scm_unittests.py
Eric Seidel (no email)
Comment 6 2011-08-17 11:19:35 PDT
Comment on attachment 104049 [details] Patch Thank you! Making the hack self-contained like this ia huge benefit for the long-term health of this code. :)
WebKit Review Bot
Comment 7 2011-08-17 12:35:00 PDT
Comment on attachment 104049 [details] Patch Rejecting attachment 104049 [details] from commit-queue. Failed to run "['./Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=ec2-cq-02', '--port..." exit_code: 2 Last 500 characters of output: svg-fonts-word-spacing.html = IMAGE+TEXT Regressions: Unexpected image mismatch : (5) fast/text/atsui-multiple-renderers.html = IMAGE fast/text/international/danda-space.html = IMAGE fast/text/international/thai-baht-space.html = IMAGE fast/text/international/thai-line-breaks.html = IMAGE platform/chromium-linux/fast/text/international/complex-joining-using-gpos.html = IMAGE Regressions: Unexpected text diff mismatch : (1) editing/selection/collapse-selection-in-bidi.html = TEXT Full output: http://queues.webkit.org/results/9420075
Adam Barth
Comment 8 2011-08-17 12:37:23 PDT
Comment on attachment 104049 [details] Patch Lies!
WebKit Review Bot
Comment 9 2011-08-17 14:15:58 PDT
Comment on attachment 104049 [details] Patch Rejecting attachment 104049 [details] from commit-queue. Failed to run "['./Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=ec2-cq-02', '--port..." exit_code: 2 Last 500 characters of output: nt): Merge conflict in Tools/ChangeLog Failed to merge in the changes. Patch failed at 0001 <rdar://problem/9971293> Mid-word breaks can occur in the middle of a surrogate pair When you have resolved this problem run "git rebase --continue". If you would prefer to skip this patch, instead run "git rebase --skip". To restore the original branch and stop rebasing run "git rebase --abort". rebase refs/remotes/origin/master: command returned error: 1 Died at Tools/Scripts/update-webkit line 146. Full output: http://queues.webkit.org/results/9422140
jochen
Comment 10 2011-08-17 14:19:06 PDT
Comment on attachment 104049 [details] Patch cq, why do you hate me?
WebKit Review Bot
Comment 11 2011-08-17 16:14:44 PDT
Comment on attachment 104049 [details] Patch Clearing flags on attachment: 104049 Committed r93257: <http://trac.webkit.org/changeset/93257>
WebKit Review Bot
Comment 12 2011-08-17 16:14:49 PDT
All reviewed patches have been landed. Closing bug.
Tim 'mithro' Ansell
Comment 13 2013-01-21 19:36:15 PST
*** Bug 31391 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.