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

TinyDNSTests.test_raise_dns_tcp fails #803

Open
mcepl opened this issue Jun 23, 2023 · 1 comment
Open

TinyDNSTests.test_raise_dns_tcp fails #803

mcepl opened this issue Jun 23, 2023 · 1 comment

Comments

@mcepl
Copy link

mcepl commented Jun 23, 2023

While packaging 0.33.3 for openSUSE/Factory from the PyPI tarball I get this failure when running the test suite:

[   84s] =================================== FAILURES ===================================
[   84s] _______________________ TinyDNSTests.test_raise_dns_tcp ________________________
[   84s] 
[   84s] self = <dns.resolver.Resolver object at 0x7f188d75e2b0>, f = '/etc/resolv.conf'
[   84s] 
[   84s]     def read_resolv_conf(self, f: Any) -> None:
[   84s]         """Process *f* as a file in the /etc/resolv.conf format.  If f is
[   84s]         a ``str``, it is used as the name of the file to open; otherwise it
[   84s]         is treated as the file itself.
[   84s]     
[   84s]         Interprets the following items:
[   84s]     
[   84s]         - nameserver - name server IP address
[   84s]     
[   84s]         - domain - local domain name
[   84s]     
[   84s]         - search - search list for host-name lookup
[   84s]     
[   84s]         - options - supported options are rotate, timeout, edns0, and ndots
[   84s]     
[   84s]         """
[   84s]     
[   84s]         if isinstance(f, str):
[   84s]             try:
[   84s] >               cm: contextlib.AbstractContextManager = open(f)
[   84s] E               FileNotFoundError: [Errno 2] No such file or directory: '/etc/resolv.conf'
[   84s] 
[   84s] /usr/lib/python3.9/site-packages/dns/resolver.py:908: FileNotFoundError
[   84s] 
[   84s] During handling of the above exception, another exception occurred:
[   84s] 
[   84s] self = <tests.greendns_test.TinyDNSTests testMethod=test_raise_dns_tcp>
[   84s] 
[   84s]     def test_raise_dns_tcp(self):
[   84s]         # https://github.com/eventlet/eventlet/issues/499
[   84s]         # None means we don't want the server to find the IP
[   84s]         with tests.dns_tcp_server(None) as dnsaddr:
[   84s] >           resolver = Resolver()
[   84s] 
[   84s] tests/greendns_test.py:891: 
[   84s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   84s] /usr/lib/python3.9/site-packages/dns/resolver.py:861: in __init__
[   84s]     self.read_resolv_conf(filename)
[   84s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   84s] 
[   84s] self = <dns.resolver.Resolver object at 0x7f188d75e2b0>, f = '/etc/resolv.conf'
[   84s] 
[   84s]     def read_resolv_conf(self, f: Any) -> None:
[   84s]         """Process *f* as a file in the /etc/resolv.conf format.  If f is
[   84s]         a ``str``, it is used as the name of the file to open; otherwise it
[   84s]         is treated as the file itself.
[   84s]     
[   84s]         Interprets the following items:
[   84s]     
[   84s]         - nameserver - name server IP address
[   84s]     
[   84s]         - domain - local domain name
[   84s]     
[   84s]         - search - search list for host-name lookup
[   84s]     
[   84s]         - options - supported options are rotate, timeout, edns0, and ndots
[   84s]     
[   84s]         """
[   84s]     
[   84s]         if isinstance(f, str):
[   84s]             try:
[   84s]                 cm: contextlib.AbstractContextManager = open(f)
[   84s]             except OSError:
[   84s]                 # /etc/resolv.conf doesn't exist, can't be read, etc.
[   84s] >               raise NoResolverConfiguration(f"cannot open {f}")
[   84s] E               dns.resolver.NoResolverConfiguration: cannot open /etc/resolv.conf
[   84s] 
[   84s] /usr/lib/python3.9/site-packages/dns/resolver.py:911: NoResolverConfiguration
[   84s] =============================== warnings summary ===============================
[   84s] eventlet/support/greenlets.py:6
[   84s]   /home/abuild/rpmbuild/BUILD/eventlet-0.33.3/eventlet/support/greenlets.py:6: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
[   84s]     preserves_excinfo = (distutils.version.LooseVersion(greenlet.__version__)
[   84s] 
[   84s] eventlet/support/greenlets.py:7
[   84s]   /home/abuild/rpmbuild/BUILD/eventlet-0.33.3/eventlet/support/greenlets.py:7: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
[   84s]     >= distutils.version.LooseVersion('0.3.2'))
[   84s] 
[   84s] eventlet/debug.py:16
[   84s]   /home/abuild/rpmbuild/BUILD/eventlet-0.33.3/eventlet/debug.py:16: DeprecationWarning: invalid escape sequence \W
[   84s]     _token_splitter = re.compile('\W+')
[   84s] 
[   84s] tests/pools_test.py:248
[   84s]   /home/abuild/rpmbuild/BUILD/eventlet-0.33.3/tests/pools_test.py:248: PytestCollectionWarning: cannot collect test class 'TestTookTooLong' because it has a __init__ constructor (from: tests/pools_test.py)
[   84s]     class TestTookTooLong(Exception):
[   84s] 
[   84s] eventlet/green/http/client.py:55
[   84s]   /home/abuild/rpmbuild/BUILD/eventlet-0.33.3/eventlet/green/http/client.py:55: DeprecationWarning: invalid escape sequence \_
[   84s]     """HTTP/1.1 client library
[   84s] 
[   84s] tests/openssl_test.py::test_import
[   84s]   /home/abuild/rpmbuild/BUILD/eventlet-0.33.3/eventlet/green/OpenSSL/crypto.py:1: DeprecationWarning: PKCS#7 support in pyOpenSSL is deprecated. You should use the APIs in cryptography.
[   84s]     from OpenSSL.crypto import *
[   84s] 
[   84s] tests/openssl_test.py::test_import
[   84s]   /home/abuild/rpmbuild/BUILD/eventlet-0.33.3/eventlet/green/OpenSSL/crypto.py:1: DeprecationWarning: PKCS#12 support in pyOpenSSL is deprecated. You should use the APIs in cryptography.
[   84s]     from OpenSSL.crypto import *
[   84s] 
[   84s] tests/tpool_test.py: 1000 warnings
[   84s]   /home/abuild/rpmbuild/BUILD/eventlet-0.33.3/tests/tpool_test.py:322: DeprecationWarning: Please use assertTrue instead.
[   84s]     assert_(token is not None)
[   84s] 
[   84s] tests/wsgi_test.py::TestHttpd::test_disable_header_name_capitalization
[   84s]   /home/abuild/rpmbuild/BUILD/eventlet-0.33.3/eventlet/greenthread.py:221: DeprecationWarning: capitalize_response_headers is disabled.
[   84s]    Please, make sure you know what you are doing.
[   84s]    HTTP headers names are case-insensitive per RFC standard.
[   84s]    Most likely, you need to fix HTTP parsing in your client software.
[   84s]     result = function(*args, **kwargs)
[   84s] 
[   84s] -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
[   84s] =========================== short test summary info ============================
[   84s] FAILED tests/greendns_test.py::TinyDNSTests::test_raise_dns_tcp - dns.resolve...
[   84s] = 1 failed, 577 passed, 108 skipped, 20 deselected, 1008 warnings in 76.85s (0:01:16) =

This is the complete build log with all details of packages used and steps to reproduce the problem.

@radeksm
Copy link
Contributor

radeksm commented Jan 9, 2024

Hi @mcepl
Just looking at the error:

dns.resolver.NoResolverConfiguration: cannot open /etc/resolv.conf

The problem doesn't seem to be related to the TinyDNSTests.test_raise_dns_tcp but rather your VM where you run that test, for whatever reason is missing /etc/resolv.conf.

IMHO, this is not a bug.

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

No branches or pull requests

2 participants