giampaolo / psutil

Cross-platform lib for process and system monitoring in Python
BSD 3-Clause "New" or "Revised" License
10.32k stars 1.39k forks source link

[OpenIndiana] TestFilters.test_count fails #2331

Open mtelka opened 1 year ago

mtelka commented 1 year ago

Summary

Description

The TestFilters.test_count test fails as follows (I added print(cons) to see what cons is):

____________________________ TestFilters.test_count ____________________________

self = <psutil.tests.test_connections.TestFilters testMethod=test_count>

    def test_count(self):
        with create_sockets():
            # tcp
            cons = thisproc.connections(kind='tcp')
            print(cons)
>           self.assertEqual(len(cons), 2 if supports_ipv6() else 1)
E           AssertionError: 3 != 2

psutil/tests/test_connections.py:404: AssertionError
----------------------------- Captured stdout call -----------------------------
[pconn(fd=-1, family=<AddressFamily.AF_INET6: 26>, type=<SocketKind.SOCK_STREAM: 2>, laddr=addr(ip='::', port=63192), raddr=(), status='LISTEN'), pconn(fd=-1, family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 2>, laddr=addr(ip='0.0.0.0', port=63192), raddr=(), status='LISTEN'), pconn(fd=-1, family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 2>, laddr=addr(ip='0.0.0.0', port=51038), raddr=(), status='LISTEN')]

This is possibly related to #2317.