]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.15] gh-154379: Fix test_epoll on Solaris (GH-154380) (GH-154382) 3.15
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 21 Jul 2026 16:44:29 +0000 (18:44 +0200)
committerGitHub <noreply@github.com>
Tue, 21 Jul 2026 16:44:29 +0000 (16:44 +0000)
A non-blocking connect() can be completed immediately, and unregistering
a closed file descriptor succeeds on Solaris.
(cherry picked from commit b6abee522f1dbbba36cc306aa99ac22d1df5c454)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Lib/test/test_epoll.py

index 5e6a4ab0166a86ff10d88c11f684dc7afdc049ec..51405ca7c9e57c3063fb7bae6a37256d24090a0a 100644 (file)
@@ -25,6 +25,7 @@ import errno
 import os
 import select
 import socket
+import sys
 import time
 import unittest
 from test import support
@@ -52,12 +53,11 @@ class TestEPoll(unittest.TestCase):
     def _connected_pair(self):
         client = socket.socket()
         client.setblocking(False)
+        # The connection is either established immediately or in progress.
         try:
             client.connect(('127.0.0.1', self.serverSocket.getsockname()[1]))
         except OSError as e:
             self.assertEqual(e.args[0], errno.EINPROGRESS)
-        else:
-            raise AssertionError("Connect should have raised EINPROGRESS")
         server, addr = self.serverSocket.accept()
 
         self.connections.extend((client, server))
@@ -218,6 +218,9 @@ class TestEPoll(unittest.TestCase):
         self.assertRaises(ValueError, select.epoll().register, -1,
                           select.EPOLLIN)
 
+    @unittest.skipIf(sys.platform.startswith('sunos'),
+                     'unregistering a closed file descriptor succeeds '
+                     'on Solaris')
     def test_unregister_closed(self):
         server, client = self._connected_pair()
         fd = server.fileno()