@@ -201,26 +201,6 @@ def setUp(self):
201
201
self .serv = socket .socket (socket .AF_INET , socket .SOCK_DGRAM , socket .IPPROTO_UDPLITE )
202
202
self .port = socket_helper .bind_port (self .serv )
203
203
204
- class ThreadSafeCleanupTestCase :
205
- """Subclass of unittest.TestCase with thread-safe cleanup methods.
206
-
207
- This subclass protects the addCleanup() method with a recursive lock.
208
-
209
- doCleanups() is called when the server completed, but the client can still
210
- be running in its thread especially if the server failed with a timeout.
211
- Don't put a lock on doCleanups() to prevent deadlock between addCleanup()
212
- called in the client and doCleanups() waiting for self.done.wait of
213
- ThreadableTest._setUp() (gh-110167)
214
- """
215
-
216
- def __init__ (self , * args , ** kwargs ):
217
- super ().__init__ (* args , ** kwargs )
218
- self ._cleanup_lock = threading .RLock ()
219
-
220
- def addCleanup (self , * args , ** kwargs ):
221
- with self ._cleanup_lock :
222
- return super ().addCleanup (* args , ** kwargs )
223
-
224
204
225
205
class SocketCANTest (unittest .TestCase ):
226
206
@@ -613,8 +593,7 @@ def setUp(self):
613
593
self .serv .listen ()
614
594
615
595
616
- class ThreadedSocketTestMixin (ThreadSafeCleanupTestCase , SocketTestBase ,
617
- ThreadableTest ):
596
+ class ThreadedSocketTestMixin (SocketTestBase , ThreadableTest ):
618
597
"""Mixin to add client socket and allow client/server tests.
619
598
620
599
Client socket is self.cli and its address is self.cli_addr. See
@@ -2698,7 +2677,7 @@ def _testRecvFromNegative(self):
2698
2677
# here assumes that datagram delivery on the local machine will be
2699
2678
# reliable.
2700
2679
2701
- class SendrecvmsgBase ( ThreadSafeCleanupTestCase ) :
2680
+ class SendrecvmsgBase :
2702
2681
# Base class for sendmsg()/recvmsg() tests.
2703
2682
2704
2683
# Time in seconds to wait before considering a test failed, or
@@ -4564,7 +4543,6 @@ def testInterruptedRecvmsgIntoTimeout(self):
4564
4543
@unittest .skipUnless (hasattr (signal , "alarm" ) or hasattr (signal , "setitimer" ),
4565
4544
"Don't have signal.alarm or signal.setitimer" )
4566
4545
class InterruptedSendTimeoutTest (InterruptedTimeoutBase ,
4567
- ThreadSafeCleanupTestCase ,
4568
4546
SocketListeningTestMixin , TCPTestBase ):
4569
4547
# Test interrupting the interruptible send*() methods with signals
4570
4548
# when a timeout is set.
0 commit comments