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

Tests broken due to mktime handling (Linux + glibc) #11786

Closed
vcunat opened this issue Dec 9, 2022 · 0 comments · Fixed by #11787
Closed

Tests broken due to mktime handling (Linux + glibc) #11786

vcunat opened this issue Dec 9, 2022 · 0 comments · Fixed by #11787
Labels

Comments

@vcunat
Copy link

vcunat commented Dec 9, 2022

Since a glibc commit, three twisted tests started to fail: test_formatTimeDefault, test_eventAsTextTimestampOnly, test_formatTimeWithDefaultFormat.

After some talk with glibc upstream, I'm inclined to think that the root of the problem is that these tests use mktime with timezone UTC+00 and indicating daylight saving which doesn't make sense (no DST in that timezone by definition).

The tests are in https://github.com/twisted/twisted/blob/twisted-22.10.0/src/twisted/logger/test/test_format.py

Testing environment

Failed logs:

===============================================================================
[FAIL]
Traceback (most recent call last):
  File "/nix/store/l2dwsswg8dd2ybqpxjy3a1iqsf5lj9d5-python3.10-twisted-22.10.0/lib/python3.10/site-packages/tw
isted/logger/test/test_format.py", line 251, in test_formatTimeDefault
    self.assertEqual(
  File "/nix/store/l2dwsswg8dd2ybqpxjy3a1iqsf5lj9d5-python3.10-twisted-22.10.0/lib/python3.10/site-packages/tw
isted/trial/_synctest.py", line 441, in assertEqual
    super().assertEqual(first, second, msg)
  File "/nix/store/xwz1n452s7913wj1338514lqzajmbgla-python3-3.10.8/lib/python3.10/unittest/case.py", line 845,
 in assertEqual
    assertion_func(first, second, msg=msg)
  File "/nix/store/xwz1n452s7913wj1338514lqzajmbgla-python3-3.10.8/lib/python3.10/unittest/case.py", line 1226
, in assertMultiLineEqual
    self.fail(self._formatMessage(msg, standardMsg))
twisted.trial.unittest.FailTest: '2013-09-24T10:40:47+0000 [-#-] XYZZY\n' != '2013-09-24T11:40:47+0000 [-#-] XYZZY\n'
- 2013-09-24T10:40:47+0000 [-#-] XYZZY
?             ^
+ 2013-09-24T11:40:47+0000 [-#-] XYZZY
?             ^


twisted.logger.test.test_format.ClassicLogFormattingTests.test_formatTimeDefault
===============================================================================
[FAIL]
Traceback (most recent call last):
  File "/nix/store/l2dwsswg8dd2ybqpxjy3a1iqsf5lj9d5-python3.10-twisted-22.10.0/lib/python3.10/site-packages/twisted/logger/test/test_format.py", line 589, in test_eventAsTextTimestampOnly
    self.assertEqual(
  File "/nix/store/l2dwsswg8dd2ybqpxjy3a1iqsf5lj9d5-python3.10-twisted-22.10.0/lib/python3.10/site-packages/twisted/trial/_synctest.py", line 441, in assertEqual
    super().assertEqual(first, second, msg)
  File "/nix/store/xwz1n452s7913wj1338514lqzajmbgla-python3-3.10.8/lib/python3.10/unittest/case.py", line 845, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/nix/store/xwz1n452s7913wj1338514lqzajmbgla-python3-3.10.8/lib/python3.10/unittest/case.py", line 1226, in assertMultiLineEqual
    self.fail(self._formatMessage(msg, standardMsg))
twisted.trial.unittest.FailTest: '2013-09-24T10:40:47+0000 ABCD' != '2013-09-24T11:40:47+0000 ABCD'
- 2013-09-24T10:40:47+0000 ABCD
?             ^
+ 2013-09-24T11:40:47+0000 ABCD
?             ^


twisted.logger.test.test_format.EventAsTextTests.test_eventAsTextTimestampOnly
===============================================================================
[FAIL]
Traceback (most recent call last):
  File "/nix/store/l2dwsswg8dd2ybqpxjy3a1iqsf5lj9d5-python3.10-twisted-22.10.0/lib/python3.10/site-packages/twisted/logger/test/test_format.py", line 176, in test_formatTimeWithDefaultFormat
    testForTimeZone(
  File "/nix/store/l2dwsswg8dd2ybqpxjy3a1iqsf5lj9d5-python3.10-twisted-22.10.0/lib/python3.10/site-packages/twisted/logger/test/test_format.py", line 172, in testForTimeZone
    self.assertEqual(formatTime(localDST), expectedDST)
  File "/nix/store/l2dwsswg8dd2ybqpxjy3a1iqsf5lj9d5-python3.10-twisted-22.10.0/lib/python3.10/site-packages/twisted/trial/_synctest.py", line 441, in assertEqual
    super().assertEqual(first, second, msg)
  File "/nix/store/xwz1n452s7913wj1338514lqzajmbgla-python3-3.10.8/lib/python3.10/unittest/case.py", line 845, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/nix/store/xwz1n452s7913wj1338514lqzajmbgla-python3-3.10.8/lib/python3.10/unittest/case.py", line 1226, in assertMultiLineEqual
    self.fail(self._formatMessage(msg, standardMsg))
twisted.trial.unittest.FailTest: '2006-06-29T23:00:00+0000' != '2006-06-30T00:00:00+0000'
- 2006-06-29T23:00:00+0000
?         ^^ ^^
+ 2006-06-30T00:00:00+0000
?         ^^ ^^


twisted.logger.test.test_format.TimeFormattingTests.test_formatTimeWithDefaultFormat
-------------------------------------------------------------------------------
@vcunat vcunat added the bug label Dec 9, 2022
eggert added a commit to eggert/twisted that referenced this issue Dec 9, 2022
twm pushed a commit to eggert/twisted that referenced this issue Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant