@@ -215,26 +215,6 @@ def setUp(self):
215
215
self .serv = socket .socket (socket .AF_INET , socket .SOCK_DGRAM , socket .IPPROTO_UDPLITE )
216
216
self .port = socket_helper .bind_port (self .serv )
217
217
218
- class ThreadSafeCleanupTestCase :
219
- """Subclass of unittest.TestCase with thread-safe cleanup methods.
220
-
221
- This subclass protects the addCleanup() method with a recursive lock.
222
-
223
- doCleanups() is called when the server completed, but the client can still
224
- be running in its thread especially if the server failed with a timeout.
225
- Don't put a lock on doCleanups() to prevent deadlock between addCleanup()
226
- called in the client and doCleanups() waiting for self.done.wait of
227
- ThreadableTest._setUp() (gh-110167)
228
- """
229
-
230
- def __init__ (self , * args , ** kwargs ):
231
- super ().__init__ (* args , ** kwargs )
232
- self ._cleanup_lock = threading .RLock ()
233
-
234
- def addCleanup (self , * args , ** kwargs ):
235
- with self ._cleanup_lock :
236
- return super ().addCleanup (* args , ** kwargs )
237
-
238
218
239
219
class SocketCANTest (unittest .TestCase ):
240
220
@@ -628,8 +608,7 @@ def setUp(self):
628
608
self .serv .listen ()
629
609
630
610
631
- class ThreadedSocketTestMixin (ThreadSafeCleanupTestCase , SocketTestBase ,
632
- ThreadableTest ):
611
+ class ThreadedSocketTestMixin (SocketTestBase , ThreadableTest ):
633
612
"""Mixin to add client socket and allow client/server tests.
634
613
635
614
Client socket is self.cli and its address is self.cli_addr. See
@@ -2815,7 +2794,7 @@ def _testRecvFromNegative(self):
2815
2794
# here assumes that datagram delivery on the local machine will be
2816
2795
# reliable.
2817
2796
2818
- class SendrecvmsgBase ( ThreadSafeCleanupTestCase ) :
2797
+ class SendrecvmsgBase :
2819
2798
# Base class for sendmsg()/recvmsg() tests.
2820
2799
2821
2800
# Time in seconds to wait before considering a test failed, or
@@ -4681,7 +4660,6 @@ def testInterruptedRecvmsgIntoTimeout(self):
4681
4660
@unittest .skipUnless (hasattr (signal , "alarm" ) or hasattr (signal , "setitimer" ),
4682
4661
"Don't have signal.alarm or signal.setitimer" )
4683
4662
class InterruptedSendTimeoutTest (InterruptedTimeoutBase ,
4684
- ThreadSafeCleanupTestCase ,
4685
4663
SocketListeningTestMixin , TCPTestBase ):
4686
4664
# Test interrupting the interruptible send*() methods with signals
4687
4665
# when a timeout is set.
0 commit comments