Opened 10 years ago
Closed 9 years ago
#12022 closed defect (fixed)
Test failure in datefmt module on OSX
Reported by: | Ryan J Ollos | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.11 |
Component: | general | Version: | |
Severity: | normal | Keywords: | unit tests macosx |
Cc: | Branch: | ||
Release Notes: |
Skip several unit tests with |
||
API Changes: | |||
Internal Changes: |
Description
====================================================================== FAIL: test_pytz_choibalsan (trac.util.tests.datefmt.LocalTimezoneTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/util/tests/datefmt.py", line 1723, in test_pytz_choibalsan self._compare_pytz(tz, '1983-10-01T00:00') # -1:00 (DST end) File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/util/tests/datefmt.py", line 1711, in _compare_pytz self._compare_pytz_localize_and_normalize(tz, dt_naive) File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/util/tests/datefmt.py", line 1688, in _compare_pytz_localize_and_normalize '%r != %r (%r)' % (dt_tz, dt_localtz, dt_naive)) AssertionError: datetime.datetime(1983, 9, 30, 22, 0, tzinfo=<DstTzInfo 'Asia/Choibalsan' CHOST+10:00:00 DST>) != datetime.datetime(1983, 9, 30, 22, 0, tzinfo=<LocalTimezone "UTC+09:00" 9:00:00>) (datetime.datetime(1983, 9, 30, 22, 0)) ----------------------------------------------------------------------
Attachments (0)
Change History (12)
comment:2 by , 10 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:3 by , 10 years ago
I haven't been able to reproduce on Windows 7 with pytz 2015.2, but the issue persists on OSX.
comment:4 by , 10 years ago
Milestone: | 1.0.6 → next-stable-1.0.x |
---|
comment:5 by , 10 years ago
Owner: | removed |
---|---|
Status: | assigned → new |
comment:6 by , 9 years ago
Milestone: | next-stable-1.0.x |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
After seeing this issue for months, I can no longer reproduce with either pytz 2015.2 or 2015.4. Maybe there was an update to OSX that fixed the issue? I'll reopen if the issue occurs again.
comment:7 by , 9 years ago
Milestone: | → next-stable-1.0.x |
---|---|
Resolution: | worksforme |
Status: | closed → reopened |
Reproduced with Mac OS X build environment on Travis CI, while trying #12208. Perhaps, mktime
in libc on Mac OS X doesn't have consistency…. I'll investigate it.
comment:8 by , 9 years ago
Owner: | set to |
---|---|
Status: | reopened → assigned |
comment:9 by , 9 years ago
Milestone: | next-stable-1.0.x → 1.0.11 |
---|
After the patch, unit and functional tests pass on Mac OS X. See https://travis-ci.org/jun66j5/trac/builds/118786133.
-
trac/util/tests/datefmt.py
diff --git a/trac/util/tests/datefmt.py b/trac/util/tests/datefmt.py index d01608ee4..0504e6d45 100644
a b class LocalTimezoneTestCase(unittest.TestCase): 1817 1817 self._compare_pytz(tz, '1982-04-01T00:00') # No DST 1818 1818 self._compare_pytz(tz, '1983-04-01T00:00') # +2:00 (TZ change) 1819 1819 self._compare_pytz(tz, '1983-04-01T02:00') # (TZ change) 1820 self._compare_pytz(tz, '1983-10-01T00:00') # -1:00 (DST end) 1820 self._compare_pytz(tz, '1983-10-01T00:00', # -1:00 (DST end) 1821 localize=False) 1821 1822 self._compare_pytz(tz, '2006-03-25T02:00') # +1:00 (DST start) 1822 self._compare_pytz(tz, '2006-09-30T02:00') # -1:00 (DST end) 1823 self._compare_pytz(tz, '2006-09-30T02:00', # -1:00 (DST end) 1824 localize=False) 1823 1825 self._compare_pytz(tz, '2007-07-01T00:00') # No DST in 2007 1824 1826 self._compare_pytz(tz, '2008-03-30T23:00', # (TZ change) 1825 1827 localize=False)
comment:10 by , 9 years ago
Travis CI is currently using OSX 10.9.5. I don't recall the version of OSX that I was running when I discovered the issue, but I'm currently running 10.11.4 and I don't see the issue. I guess it's probably difficult to determine the exact version of OSX in which the issue is fixed.
comment:11 by , 9 years ago
Thanks. I'm using OSX 10.10.5 (version of libSystem.dylib is 1213.0.0). This issue cannot be reproduced on my environment. The test cases isn't important. It's no problem to skip the cases.
$ sw_vers -productVersion 10.10.5 $ ls -l /usr/lib/libc.* lrwxr-xr-x 1 root wheel 15 Jun 26 2015 /usr/lib/libc.dylib -> libSystem.dylib $ otool -L /usr/lib/libc.dylib | grep libSystem /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
comment:12 by , 9 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Could be unrelated to OSX, rather due to using a newer version of
pytz
. I haven't tested on any other platforms yet.The failing assertions are trunk/trac/util/tests/datefmt.py@12788:1723-1725#L1713, confirmed by commenting out the failing assertions so that other assertions in test case would be executed.