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 failure in test_filehandler_reopen_thread_safety on Python 3.13 #96

Closed
musicinmybrain opened this issue May 11, 2024 · 3 comments · Fixed by #97
Closed

Test failure in test_filehandler_reopen_thread_safety on Python 3.13 #96

musicinmybrain opened this issue May 11, 2024 · 3 comments · Fixed by #97

Comments

@musicinmybrain
Copy link
Contributor

BUG/PROBLEM REPORT / FEATURE REQUEST

What I did:

  1. Check out current master, abf6f26
  2. Run tox -e py313

What I expect to happen:

All tests pass, as they do for tox -e py312.

What actually happened:

Failure in test test_filehandler_reopen_thread_safety (ZConfig.components.logger.tests.test_logger.TestReopeningLogfiles.test_filehandler_reopen_thread_safety)
Traceback (most recent call last):
  File "/usr/lib64/python3.13/unittest/case.py", line 58, in testPartExecutor
    yield
  File "/usr/lib64/python3.13/unittest/case.py", line 651, in run
    self._callTestMethod(testMethod)
  File "/usr/lib64/python3.13/unittest/case.py", line 606, in _callTestMethod
    if method() is not None:
  File "/home/ben/src/forks/ZConfig/src/ZConfig/components/logger/tests/test_logger.py", line 714, in test_filehandler_reopen_thread_safety
    self.assertEqual(calls, ["acquire", "acquire", "release", "release"])
  File "/usr/lib64/python3.13/unittest/case.py", line 907, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/lib64/python3.13/unittest/case.py", line 1113, in assertListEqual
    self.assertSequenceEqual(list1, list2, msg, seq_type=list)
  File "/usr/lib64/python3.13/unittest/case.py", line 1095, in assertSequenceEqual
    self.fail(msg)
  File "/usr/lib64/python3.13/unittest/case.py", line 732, in fail
    raise self.failureException(msg)
AssertionError: Lists differ: [] != ['acquire', 'acquire', 'release', 'release']

Second list contains 4 additional elements.
First extra element 0:
'acquire'

- []
+ ['acquire', 'acquire', 'release', 'release']

------
2024-05-11T11:12:45 INFO root An info message
------
2024-05-11T11:12:45 INFO root We see an info message
------
2024-05-11T11:12:45 INFO root Here is another info message
/home/ben/src/forks/ZConfig/src/ZConfig/tests/test_schema2html.py:106: DeprecationWarning: The frontend.OptionParser class will be replaced by a subclass of argparse.ArgumentParser in Docutils 0.21 or later.
  settings=docutils.frontend.OptionParser(
/usr/lib64/python3.13/optparse.py:1000: DeprecationWarning: The frontend.Option class will be removed in Docutils 0.21 or later.
  option = self.option_class(*args, **kwargs)
/home/ben/src/forks/ZConfig/src/ZConfig/tests/test_schema2html.py:106: DeprecationWarning: The frontend.OptionParser class will be replaced by a subclass of argparse.ArgumentParser in Docutils 0.21 or later.
  settings=docutils.frontend.OptionParser(
/usr/lib64/python3.13/optparse.py:1000: DeprecationWarning: The frontend.Option class will be removed in Docutils 0.21 or later.
  option = self.option_class(*args, **kwargs)
/home/ben/src/forks/ZConfig/src/ZConfig/tests/test_schema2html.py:106: DeprecationWarning: The frontend.OptionParser class will be replaced by a subclass of argparse.ArgumentParser in Docutils 0.21 or later.
  settings=docutils.frontend.OptionParser(
/usr/lib64/python3.13/optparse.py:1000: DeprecationWarning: The frontend.Option class will be removed in Docutils 0.21 or later.
  option = self.option_class(*args, **kwargs)
/home/ben/src/forks/ZConfig/src/ZConfig/tests/test_schema2html.py:106: DeprecationWarning: The frontend.OptionParser class will be replaced by a subclass of argparse.ArgumentParser in Docutils 0.21 or later.
  settings=docutils.frontend.OptionParser(
/usr/lib64/python3.13/optparse.py:1000: DeprecationWarning: The frontend.Option class will be removed in Docutils 0.21 or later.
  option = self.option_class(*args, **kwargs)
/home/ben/src/forks/ZConfig/src/ZConfig/tests/test_schema2html.py:106: DeprecationWarning: The frontend.OptionParser class will be replaced by a subclass of argparse.ArgumentParser in Docutils 0.21 or later.
  settings=docutils.frontend.OptionParser(
/usr/lib64/python3.13/optparse.py:1000: DeprecationWarning: The frontend.Option class will be removed in Docutils 0.21 or later.
  option = self.option_class(*args, **kwargs)

What version of Python and Zope/Addons I am using:

Fedora Linux 39, Python 3.13.0a6, Zope versions as installed to the virtualenv by default: zope.exceptions 5.0.1, zope.interface 6.3, zope.testrunner 6.4


It wasn’t immediately obvious to me what the best way to fix this should be. I believe it may be related to python/cpython#109461 / python/cpython#109462 / python/cpython#109462.

@icemac icemac mentioned this issue May 14, 2024
2 tasks
@icemac
Copy link
Member

icemac commented May 14, 2024

Thank you for your report. I created a PR in #97 to reproduce it in CI. But running on 3.13b1 requires a fix in zope.interface first.

@musicinmybrain
Copy link
Contributor Author

Thank you for your report. I created a PR in #97 to reproduce it in CI. But running on 3.13b1 requires a fix in zope.interface first.

Thanks! I can confirm that – when I skip this test downstream – I also run into the bug that zopefoundation/zope.interface#294 is trying to fix. Looks like that should be dealt with soon.

@icemac
Copy link
Member

icemac commented May 16, 2024

After zope.interface is fixed now, GitHub Actions also show this problem.
I have no idea what to do to fix it.

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

Successfully merging a pull request may close this issue.

2 participants