From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 21 Jul 2026 16:31:13 +0000 (+0200) Subject: [3.14] gh-154379: Fix test_epoll on Solaris (GH-154380) (GH-154383) X-Git-Url: http://git.ipfire.org/index.cgi?a=commitdiff_plain;h=ec9587270e04bed5756d1e2a3c7afb43c41df5e6;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-154379: Fix test_epoll on Solaris (GH-154380) (GH-154383) 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 Co-authored-by: Claude Opus 4.8 --- diff --git a/Lib/test/test_epoll.py b/Lib/test/test_epoll.py index c94946a6ae6b..8195f437843e 100644 --- a/Lib/test/test_epoll.py +++ b/Lib/test/test_epoll.py @@ -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()