Issue 17713: test_logging fails in test_compute_rollover_weekly_attime (original) (raw)

Created on 2013-04-13 13:49 by nedbat, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue17713.patch sphickson,2013-04-13 20:57 Patch to resolve Issue 17713 - errors in test_compute_rollover_weekly_attime
Messages (9)
msg186717 - (view) Author: Ned Batchelder (nedbat) * (Python triager) Date: 2013-04-13 13:49
I just pulled down the tip of CPython, built it, and ran the tests, and got this failure: ``` ====================================================================== FAIL: test_compute_rollover_weekly_attime (test.test_logging.TimedRotatingFileHandlerTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/ned/python/cpython/Lib/test/test_logging.py", line 3972, in test_compute_rollover_weekly_attime wday = datetime.datetime.fromtimestamp(currentTime).weekday() AssertionError: 388800 != 475200 ---------------------------------------------------------------------- Ran 149 tests in 17.142s FAILED (failures=1, skipped=1) test test_logging failed 1 test failed: test_logging sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/test_logging-2-gimdv3.log' mode='a' encoding='UTF-8'> ``` Others preparing for today's sprint in Boston also had the same problem. Something to do with timezones?
msg186753 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-04-13 16:35
New changeset 185ae0c95e5b by Vinay Sajip in branch 'default': Issue #17713: Test temporarily skipped while failure investigated. http://hg.python.org/cpython/rev/185ae0c95e5b
msg186819 - (view) Author: Shaun Hickson (sphickson) * Date: 2013-04-13 20:14
I was looking at this yesterday and this morning a little bit, and the expected value is too large by a day (e.g. as the test currently runs, actual = expected - (24 * 60 * 60)).
msg186843 - (view) Author: Shaun Hickson (sphickson) * Date: 2013-04-13 20:57
Patch to fix test_compute_rollover_weekly_attime: 1) Use 6 rather than 7 for calculating expected rollover day 2) Roll all cases (rollover day earlier than current day, both days the same, and current day earlier than rollover day) into one if/else statement
msg186845 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-04-13 21:04
Shaun, your patch fails if I remove the @skip decorator: ====================================================================== FAIL: test_compute_rollover_weekly_attime (test.test_logging.TimedRotatingFileHandlerTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/antoine/cpython/default/Lib/test/test_logging.py", line 3989, in test_compute_rollover_weekly_attime self.assertEqual(actual, expected) AssertionError: 388800 != 302400 On the other hand, the original test works fine here. I guess the diagnosing isn't complete yet :-)
msg186847 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-04-13 21:08
I also find the original code totally unreadable. Why "currentTime = 0"? Why no comments on the various calculations? Vinay, it would be nice if you could make some efforts here.
msg186911 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-04-14 11:21
New changeset 1494daf809c1 by Vinay Sajip in branch 'default': Closes #17713: Fixed bug in test_compute_rollover_weekly_attime. http://hg.python.org/cpython/rev/1494daf809c1
msg186912 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-04-14 11:25
New changeset efda51b85b31 by Vinay Sajip in branch 'default': Issue #17713: additional tweak to test. http://hg.python.org/cpython/rev/efda51b85b31
msg186972 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-04-15 10:59
New changeset 193e7ad92900 by Vinay Sajip in branch 'default': Issue #17713: Added failure diagnostics to test. http://hg.python.org/cpython/rev/193e7ad92900
History
Date User Action Args
2022-04-11 14:57:44 admin set github: 61913
2013-04-15 10:59:45 python-dev set messages: +
2013-04-14 11:25:39 python-dev set messages: +
2013-04-14 11:21:01 python-dev set status: open -> closedresolution: fixedmessages: + stage: resolved
2013-04-13 21:08:16 pitrou set messages: +
2013-04-13 21:04:40 pitrou set nosy: + pitroumessages: +
2013-04-13 20:57:30 sphickson set files: + issue17713.patchkeywords: + patchmessages: +
2013-04-13 20:14:21 sphickson set nosy: + sphicksonmessages: +
2013-04-13 17:13:48 vinay.sajip set assignee: vinay.sajiptype: behaviorcomponents: + Library (Lib)versions: + Python 3.4
2013-04-13 16:35:25 python-dev set nosy: + python-devmessages: +
2013-04-13 13:58:43 pitrou set nosy: + vinay.sajip
2013-04-13 13:49:57 nedbat create