]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-154379: Fix test_epoll on Solaris (GH-154380) (GH-154383)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 21 Jul 2026 16:31:13 +0000 (18:31 +0200)
committerGitHub <noreply@github.com>
Tue, 21 Jul 2026 16:31:13 +0000 (16:31 +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 c94946a6ae6b7c3cff93f9d16c9fa19e4750b274..8195f437843e517e2263b1d7ac7cdd6d577cb885 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()