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

[OpenIndiana] test_connections tests fails #2317

Closed
mtelka opened this issue Oct 16, 2023 · 2 comments
Closed

[OpenIndiana] test_connections tests fails #2317

mtelka opened this issue Oct 16, 2023 · 2 comments

Comments

@mtelka
Copy link
Contributor

mtelka commented Oct 16, 2023

Summary

  • OS: OpenIndiana
  • Architecture: 64bit
  • Psutil version: 5.9.6
  • Python version: 3.9.16
  • Type: tests

Description

The following fifteen tests in psutil/tests/test_connections.py fails:

FAILED psutil/tests/test_connections.py::TestBasicOperations::test_invalid_kind
FAILED psutil/tests/test_connections.py::TestBasicOperations::test_process - ...
FAILED psutil/tests/test_connections.py::TestBasicOperations::test_system - A...
FAILED psutil/tests/test_connections.py::TestUnconnectedSockets::test_tcp_v4
FAILED psutil/tests/test_connections.py::TestUnconnectedSockets::test_tcp_v6
FAILED psutil/tests/test_connections.py::TestUnconnectedSockets::test_udp_v4
FAILED psutil/tests/test_connections.py::TestUnconnectedSockets::test_udp_v6
FAILED psutil/tests/test_connections.py::TestUnconnectedSockets::test_unix_tcp
FAILED psutil/tests/test_connections.py::TestUnconnectedSockets::test_unix_udp
FAILED psutil/tests/test_connections.py::TestConnectedSocket::test_unix - Ass...
FAILED psutil/tests/test_connections.py::TestFilters::test_combos - Assertion...
FAILED psutil/tests/test_connections.py::TestFilters::test_count - AssertionE...
FAILED psutil/tests/test_connections.py::TestFilters::test_filters - Assertio...
FAILED psutil/tests/test_connections.py::TestSystemWideConnections::test_it
FAILED psutil/tests/test_connections.py::TestSystemWideConnections::test_multi_sockets_procs

All failures are these:

____________________ TestBasicOperations.test_invalid_kind _____________________
        
self = <psutil.tests.test_connections.TestBasicOperations testMethod=test_invalid_kind>

    def setUp(self):
        if not (NETBSD or FREEBSD):
            # process opens a UNIX socket to /var/log/run.
            cons = thisproc.connections(kind='all')
>           assert not cons, cons
E           AssertionError: [pconn(fd=-1, family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 2>, laddr=addr(ip='127.0.0.1', port=43979), raddr=(), status='LISTEN')]
E           assert not [pconn(fd=-1, family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 2>, laddr=addr(ip='127.0.0.1', port=43979), raddr=(), status='LISTEN')]

psutil/tests/test_connections.py:58: AssertionError
@mtelka mtelka added the bug label Oct 16, 2023
@github-actions github-actions bot added the tests label Oct 16, 2023
@mtelka
Copy link
Contributor Author

mtelka commented Nov 29, 2023

As a workaround I applied the following patch:

--- psutil-5.9.6/psutil/tests/test_connections.py.orig
+++ psutil-5.9.6/psutil/tests/test_connections.py
@@ -52,13 +52,13 @@
 class ConnectionTestCase(PsutilTestCase):
 
     def setUp(self):
-        if not (NETBSD or FREEBSD):
+        if not (NETBSD or FREEBSD or SUNOS):
             # process opens a UNIX socket to /var/log/run.
             cons = thisproc.connections(kind='all')
             assert not cons, cons
 
     def tearDown(self):
-        if not (FREEBSD or NETBSD):
+        if not (FREEBSD or NETBSD or SUNOS):
             # Make sure we closed all resources.
             # NetBSD opens a UNIX socket to /var/log/run.
             cons = thisproc.connections(kind='all')

@mtelka
Copy link
Contributor Author

mtelka commented Jan 21, 2024

This issue is not reproducible with psutil 5.9.8.

@mtelka mtelka closed this as completed Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant