Skip to content

Commit c2ce6e2

Browse files
committed
Ignore tests that need AF_UNIX family
1 parent c88cb35 commit c2ce6e2

File tree

12 files changed

+55
-19
lines changed

12 files changed

+55
-19
lines changed

graalpython/lib-python/3/multiprocessing/connection.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@
4747
default_family = 'AF_INET'
4848
families = ['AF_INET']
4949

50-
if hasattr(socket, 'AF_UNIX'):
51-
default_family = 'AF_UNIX'
52-
families += ['AF_UNIX']
50+
# Begin Truffle change
51+
# if hasattr(socket, 'AF_UNIX'):
52+
# default_family = 'AF_UNIX'
53+
# families += ['AF_UNIX']
54+
# End Truffle change
5355

5456
if sys.platform == 'win32':
5557
default_family = 'AF_PIPE'

graalpython/lib-python/3/test/_test_multiprocessing.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3344,7 +3344,9 @@ def test_context(self):
33443344
if self.TYPE == 'processes':
33453345
self.assertRaises(OSError, l.accept)
33463346

3347+
# GR-28433
33473348
@unittest.skipIf(IS_LINUX, "module 'socket' has no attribute 'AF_UNIX'")
3349+
@unittest.skipIf(sys.implementation.name == 'graalpython', "module 'socket' has no attribute 'AF_UNIX'")
33483350
@unittest.skipUnless(util.abstract_sockets_supported,
33493351
"test needs abstract socket support")
33503352
def test_abstract_socket(self):

graalpython/lib-python/3/test/support/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2718,7 +2718,8 @@ def skip_if_pgo_task(test):
27182718
_bind_nix_socket_error = None
27192719
def skip_unless_bind_unix_socket(test):
27202720
"""Decorator for tests requiring a functional bind() for unix sockets."""
2721-
if not hasattr(socket, 'AF_UNIX'):
2721+
# GR-28433
2722+
if (not hasattr(socket, 'AF_UNIX')) or sys.implementation.name == 'graalpython':
27222723
return unittest.skip('No UNIX Sockets')(test)
27232724
global _bind_nix_socket_error
27242725
if _bind_nix_socket_error is None:

graalpython/lib-python/3/test/test_asyncio/functional.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ def tcp_server(self, server_prog, *,
5454
max_clients=10):
5555

5656
if addr is None:
57-
if hasattr(socket, 'AF_UNIX') and family == socket.AF_UNIX:
57+
# GR-28433
58+
import sys
59+
if hasattr(socket, 'AF_UNIX') and family == socket.AF_UNIX and sys.implementation.name != 'graalpython':
5860
with tempfile.NamedTemporaryFile() as tmp:
5961
addr = tmp.name
6062
else:

graalpython/lib-python/3/test/test_asyncio/test_base_events.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,6 +1683,7 @@ def test_create_datagram_endpoint_sock(self):
16831683
self.loop.run_until_complete(protocol.done)
16841684
self.assertEqual('CLOSED', protocol.state)
16851685

1686+
@unittest.skipIf(sys.implementation.name == 'graalpython', 'GR-28433')
16861687
@unittest.skipUnless(hasattr(socket, 'AF_UNIX'), 'No UNIX Sockets')
16871688
def test_create_datagram_endpoint_sock_unix(self):
16881689
fut = self.loop.create_datagram_endpoint(

graalpython/lib-python/3/test/test_asyncio/test_events.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,7 @@ def test_create_unix_server(self):
868868
# close server
869869
server.close()
870870

871+
@unittest.skipIf(sys.implementation.name == 'graalpython', 'GR-28433')
871872
@unittest.skipUnless(hasattr(socket, 'AF_UNIX'), 'No UNIX Sockets')
872873
def test_create_unix_server_path_socket_error(self):
873874
proto = MyProto(loop=self.loop)

graalpython/lib-python/3/test/test_asyncio/test_unix_events.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ def test_close_on_finalizing(self, m_signal, m_sys):
264264
self.assertFalse(m_signal.signal.called)
265265

266266

267+
@unittest.skipIf(sys.implementation.name == 'graalpython', 'GR-28433')
267268
@unittest.skipUnless(hasattr(socket, 'AF_UNIX'),
268269
'UNIX Sockets are not supported')
269270
class SelectorEventLoopUnixSocketTests(test_utils.TestCase):

graalpython/lib-python/3/test/test_asyncore.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717

1818

1919
TIMEOUT = 3
20-
HAS_UNIX_SOCKETS = hasattr(socket, 'AF_UNIX')
20+
# GR-28433
21+
HAS_UNIX_SOCKETS = hasattr(socket, 'AF_UNIX') and sys.implementation.name != 'graalpython'
22+
2123

2224
class dummysocket:
2325
def __init__(self):

graalpython/lib-python/3/test/test_logging.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,13 +1055,17 @@ def server_close(self):
10551055
super(TestUDPServer, self).server_close()
10561056
self._closed = True
10571057

1058-
if hasattr(socket, "AF_UNIX"):
1058+
1059+
# GR-28433
1060+
if hasattr(socket, "AF_UNIX") and sys.implementation.name != 'graalpython':
10591061
class TestUnixStreamServer(TestTCPServer):
10601062
address_family = socket.AF_UNIX
10611063

1064+
10621065
class TestUnixDatagramServer(TestUDPServer):
10631066
address_family = socket.AF_UNIX
10641067

1068+
10651069
# - end of server_helper section
10661070

10671071
class SMTPHandlerTest(BaseTest):
@@ -1732,12 +1736,13 @@ def _get_temp_domain_socket():
17321736
os.remove(fn)
17331737
return fn
17341738

1735-
@unittest.skipUnless(hasattr(socket, "AF_UNIX"), "Unix sockets required")
1736-
class UnixSocketHandlerTest(SocketHandlerTest):
17371739

1740+
# GR-28433
1741+
@unittest.skipUnless(hasattr(socket, "AF_UNIX") and sys.implementation.name != 'graalpython', "Unix sockets required")
1742+
class UnixSocketHandlerTest(SocketHandlerTest):
17381743
"""Test for SocketHandler with unix sockets."""
17391744

1740-
if hasattr(socket, "AF_UNIX"):
1745+
if hasattr(socket, "AF_UNIX") and sys.implementation.name != 'graalpython':
17411746
server_class = TestUnixStreamServer
17421747

17431748
def setUp(self):
@@ -1813,12 +1818,13 @@ def test_output(self):
18131818
self.handled.wait()
18141819
self.assertEqual(self.log_output, "spam\neggs\n")
18151820

1816-
@unittest.skipUnless(hasattr(socket, "AF_UNIX"), "Unix sockets required")
1817-
class UnixDatagramHandlerTest(DatagramHandlerTest):
18181821

1822+
# GR-28433
1823+
@unittest.skipUnless(hasattr(socket, "AF_UNIX") and sys.implementation.name != 'graalpython', "Unix sockets required")
1824+
class UnixDatagramHandlerTest(DatagramHandlerTest):
18191825
"""Test for DatagramHandler using Unix sockets."""
18201826

1821-
if hasattr(socket, "AF_UNIX"):
1827+
if hasattr(socket, "AF_UNIX") and sys.implementation.name != 'graalpython':
18221828
server_class = TestUnixDatagramServer
18231829

18241830
def setUp(self):
@@ -1897,12 +1903,13 @@ def test_output(self):
18971903
self.handled.wait()
18981904
self.assertEqual(self.log_output, b'<11>h\xc3\xa4m-sp\xc3\xa4m')
18991905

1900-
@unittest.skipUnless(hasattr(socket, "AF_UNIX"), "Unix sockets required")
1901-
class UnixSysLogHandlerTest(SysLogHandlerTest):
19021906

1907+
# GR-28433
1908+
@unittest.skipUnless(hasattr(socket, "AF_UNIX") and sys.implementation.name != 'graalpython', "Unix sockets required")
1909+
class UnixSysLogHandlerTest(SysLogHandlerTest):
19031910
"""Test for SysLogHandler with Unix sockets."""
19041911

1905-
if hasattr(socket, "AF_UNIX"):
1912+
if hasattr(socket, "AF_UNIX") and sys.implementation.name != 'graalpython':
19061913
server_class = TestUnixDatagramServer
19071914

19081915
def setUp(self):

graalpython/lib-python/3/test/test_pathlib.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2055,6 +2055,7 @@ def test_is_socket_false(self):
20552055
self.assertIs((P / 'fileA\udfff').is_socket(), False)
20562056
self.assertIs((P / 'fileA\x00').is_socket(), False)
20572057

2058+
@unittest.skipIf(sys.implementation.name == 'graalpython', 'GR-28433')
20582059
@unittest.skipUnless(hasattr(socket, "AF_UNIX"), "Unix sockets required")
20592060
def test_is_socket_true(self):
20602061
P = self.cls(BASE, 'mysock')

0 commit comments

Comments
 (0)