gh-154379: Fix test_epoll on Solaris (GH-154380)

serhiy-storchaka <[email protected]>
Newsgroups gmane.comp.python.cvs
Message-ID <[email protected]>
https://github.com/python/cpython/commit/b6abee522f1dbbba36cc306aa99ac22d1df5c454
commit: b6abee522f1dbbba36cc306aa99ac22d1df5c454
branch: main
author: Serhiy Storchaka <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-07-21T16:02:51Z
summary:

gh-154379: Fix test_epoll on Solaris (GH-154380)

A non-blocking connect() can be completed immediately, and unregistering
a closed file descriptor succeeds on Solaris.

Co-authored-by: Claude Opus 4.8 <[email protected]>

files:
M Lib/test/test_epoll.py

diff --git a/Lib/test/test_epoll.py b/Lib/test/test_epoll.py
index 5e6a4ab0166a86..51405ca7c9e57c 100644
--- a/Lib/test/test_epoll.py
+++ b/Lib/test/test_epoll.py
@@ -25,6 +25,7 @@
 import os
 import select
 import socket
+import sys
 import time
 import unittest
 from test import support
@@ -52,12 +53,11 @@ def tearDown(self):
     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 @@ def test_errors(self):
         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()

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.