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

Test failures with Python 3.12 b1 & b2 #3278

Closed
hrnciar opened this issue Jun 8, 2023 · 1 comment · Fixed by #3288
Closed

Test failures with Python 3.12 b1 & b2 #3278

hrnciar opened this issue Jun 8, 2023 · 1 comment · Fixed by #3288

Comments

@hrnciar
Copy link

hrnciar commented Jun 8, 2023

Hello,

I'd like to ask for help with tornado and its compatibility with Python 3.12. Up until the 7th alpha tornado was building fine. I started to see the following failures with the 1st beta. You can see the failure also in CI of this PR #3277.

Thank you.

======================================================================
FAIL: test_chunked (tornado.test.httpclient_test.HTTPClientCommonTestCase.test_chunked)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/tornado-6.3.2/tornado/testing.py", line 102, in __call__
    result = self.orig_method(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/tornado-6.3.2/tornado/test/httpclient_test.py", line 225, in test_chunked
    self.assertEqual(chunks, [b"asdf", b"qwer"])
AssertionError: Lists differ: [b'asdfqwer'] != [b'asdf', b'qwer']

First differing element 0:
b'asdfqwer'
b'asdf'

Second list contains 1 additional elements.
First extra element 1:
b'qwer'

- [b'asdfqwer']
+ [b'asdf', b'qwer']
?        +++++


======================================================================
FAIL: test_gzip (tornado.test.httpclient_test.HTTPClientCommonTestCase.test_gzip)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/tornado-6.3.2/tornado/testing.py", line 102, in __call__
    result = self.orig_method(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/tornado-6.3.2/tornado/test/httpclient_test.py", line 438, in test_gzip
    self.assertEqual(len(response.body), 34)
AssertionError: 28 != 34

======================================================================
FAIL: test_header_callback (tornado.test.httpclient_test.HTTPClientCommonTestCase.test_header_callback)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/tornado-6.3.2/tornado/testing.py", line 102, in __call__
    result = self.orig_method(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/tornado-6.3.2/tornado/test/httpclient_test.py", line 484, in test_header_callback
    self.assertEqual(chunks, [b"asdf", b"qwer"])
AssertionError: Lists differ: [b'asdfqwer'] != [b'asdf', b'qwer']

First differing element 0:
b'asdfqwer'
b'asdf'

Second list contains 1 additional elements.
First extra element 1:
b'qwer'

- [b'asdfqwer']
+ [b'asdf', b'qwer']
?        +++++


======================================================================
FAIL: test_chunked (tornado.test.simple_httpclient_test.SimpleHTTPClientCommonTestCase.test_chunked)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/tornado-6.3.2/tornado/testing.py", line 102, in __call__
    result = self.orig_method(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/tornado-6.3.2/tornado/test/httpclient_test.py", line 225, in test_chunked
    self.assertEqual(chunks, [b"asdf", b"qwer"])
AssertionError: Lists differ: [b'asdfqwer'] != [b'asdf', b'qwer']

First differing element 0:
b'asdfqwer'
b'asdf'

Second list contains 1 additional elements.
First extra element 1:
b'qwer'

- [b'asdfqwer']
+ [b'asdf', b'qwer']
?        +++++


======================================================================
FAIL: test_gzip (tornado.test.simple_httpclient_test.SimpleHTTPClientCommonTestCase.test_gzip)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/tornado-6.3.2/tornado/testing.py", line 102, in __call__
    result = self.orig_method(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/tornado-6.3.2/tornado/test/httpclient_test.py", line 438, in test_gzip
    self.assertEqual(len(response.body), 34)
AssertionError: 28 != 34

======================================================================
FAIL: test_header_callback (tornado.test.simple_httpclient_test.SimpleHTTPClientCommonTestCase.test_header_callback)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/tornado-6.3.2/tornado/testing.py", line 102, in __call__
    result = self.orig_method(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/tornado-6.3.2/tornado/test/httpclient_test.py", line 484, in test_header_callback
    self.assertEqual(chunks, [b"asdf", b"qwer"])
AssertionError: Lists differ: [b'asdfqwer'] != [b'asdf', b'qwer']

First differing element 0:
b'asdfqwer'
b'asdf'

Second list contains 1 additional elements.
First extra element 1:
b'qwer'

- [b'asdfqwer']
+ [b'asdf', b'qwer']
?        +++++


----------------------------------------------------------------------
Ran 1189 tests in 17.011s

FAILED (failures=6, skipped=66)
@bdarnell
Copy link
Member

This is a bug introduced by a change to the python standard library's gzip module: python/cpython#105808. Hopefully it'll get fixed in an upcoming beta.

There are also other things that broke with the 3.12 betas: we need to upgrade tox, and there are some deprecation warnings in datetime that we have to work around. I have patches for those issues but there's no clean way to work around the GzipFile bug so I'm going to disable 3.12 in CI until the fix comes out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants