File tree Expand file tree Collapse file tree 2 files changed +2
-11
lines changed 
Lib/test/test_concurrent_futures Expand file tree Collapse file tree 2 files changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -114,8 +114,9 @@ def test_all_completed(self):
114114
115115    def  test_timeout (self ):
116116        short_timeout  =  0.050 
117+         long_timeout  =  short_timeout  *  10 
117118
118-         future  =  self .executor .submit (self . event . wait )
119+         future  =  self .executor .submit (time . sleep ,  long_timeout )
119120
120121        finished , pending  =  futures .wait (
121122                [CANCELLED_AND_NOTIFIED_FUTURE ,
@@ -131,9 +132,6 @@ def test_timeout(self):
131132                         finished )
132133        self .assertEqual (set ([future ]), pending )
133134
134-         # Set the event to allow the future to complete 
135-         self .event .set ()
136- 
137135
138136class  ThreadPoolWaitTests (ThreadPoolMixin , WaitTests , BaseTestCase ):
139137
Original file line number Diff line number Diff line change 11import  multiprocessing 
22import  sys 
3- import  threading 
43import  time 
54import  unittest 
65from  concurrent  import  futures 
@@ -47,24 +46,18 @@ def setUp(self):
4746
4847        self .t1  =  time .monotonic ()
4948        if  hasattr (self , "ctx" ):
50-             self .manager  =  multiprocessing .Manager ()
51-             self .event  =  self .manager .Event ()
5249            self .executor  =  self .executor_type (
5350                max_workers = self .worker_count ,
5451                mp_context = self .get_context (),
5552                ** self .executor_kwargs )
5653        else :
57-             self .event  =  threading .Event ()
5854            self .executor  =  self .executor_type (
5955                max_workers = self .worker_count ,
6056                ** self .executor_kwargs )
6157
6258    def  tearDown (self ):
6359        self .executor .shutdown (wait = True )
6460        self .executor  =  None 
65-         if  hasattr (self , "ctx" ):
66-             self .manager .shutdown ()
67-             self .manager  =  None 
6861
6962        dt  =  time .monotonic () -  self .t1 
7063        if  support .verbose :
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments