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
Many multiprocessing tests are silently skipped since 3.9 #89205
Comments
Here is a list of multiprocessing tests which are run in 3.8 but are not found in 3.9+: OtherTest.test_answer_challenge_auth_failure |
Looks like that this happens because tests classes are decorated with cpython/Lib/test/_test_multiprocessing.py Lines 4482 to 4485 in 2a8127c
Tests above run fine without this decorator. The problem is that `` was treating a decorated entity as a function, not a class.
So, it needs to changed to respect classes. I will make a PR shortly. |
Wow. I hope this didn't hide any regression :-( |
Looks like it did, two newly-unignored tests are failing: пн, 30 авг. 2021 г. в 15:16, Antoine Pitrou <report@bugs.python.org>:
|
Thank you Nikita. The difference between the original and the proposed in PR 28060 code is that in the original code the conditional was tested at the testing time, while in the proposed code it is tested at the loading time. I do not know what effect it causes on tests. If it does not matter, the code can be simpler: return unittest.skipIf(should_be_skipped,
f"hash digest '{digestname}' is not available.") But if it matters, there are two options:
|
Here is the implementation of the second option: def requires_hashdigest(digestname, openssl=None, usedforsecurity=True):
def decorator(func):
if isinstance(func, type):
setUpClass = func.__dict__.get('setUpClass')
if setUpClass is None:
def setUpClass(cls):
super(func, cls).setUpClass()
setUpClass.__qualname__ = func.__qualname__ + '.setUpClass'
setUpClass.__module__ = func.__module__
else:
setUpClass = setUpClass.__func__
setUpClass = classmethod(decorator(setUpClass))
func.setUpClass = setUpClass
return func
@functools.wraps(func)
def wrapper(*args, **kwargs):
try:
if openssl and _hashlib is not None:
_hashlib.new(digestname, usedforsecurity=usedforsecurity)
else:
hashlib.new(digestname, usedforsecurity=usedforsecurity)
except ValueError:
raise unittest.SkipTest(
f"hash digest '{digestname}' is not available."
)
return func(*args, **kwargs)
return wrapper
return decorator |
Serhiy, yes, you are right. I guess, it is safe to assume that load-time/test-time might make a difference, especially with I've commited your suggestion, thanks a lot for your help! |
FYI, there seem to be two Windows-specific regressions since the tests were unintentionally disabled, namely test_shared_memory_basics and test_checksum_fodder. Following Serhiy's advice, I elect to have those tests skipped for now on Windows and fix them through separate issues. We will be releasing 3.9.7 according to schedule today. |
Two new issues created: |
See also bpo-45128 (fixed): "test_multiprocessing_fork fails if run sequentially after test_genericalias and test_logging". |
requires_hashdigest
are not skipped #28060requires_hashdigest
are not skipped (GH-28060) #28168test_shared_memory_basics
test #28182Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: