File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ class ExecutorMixin:
109
109
def setUp (self ):
110
110
super ().setUp ()
111
111
112
- self .t1 = time .time ()
112
+ self .t1 = time .monotonic ()
113
113
if hasattr (self , "ctx" ):
114
114
self .executor = self .executor_type (
115
115
max_workers = self .worker_count ,
@@ -125,10 +125,10 @@ def tearDown(self):
125
125
self .executor .shutdown (wait = True )
126
126
self .executor = None
127
127
128
- dt = time .time () - self .t1
128
+ dt = time .monotonic () - self .t1
129
129
if test .support .verbose :
130
130
print ("%.2fs" % dt , end = ' ' )
131
- self .assertLess (dt , 60 , "synchronization issue: test lasted too long" )
131
+ self .assertLess (dt , 300 , "synchronization issue: test lasted too long" )
132
132
133
133
super ().tearDown ()
134
134
@@ -240,9 +240,9 @@ def test_initializer(self):
240
240
with self .assertRaises (BrokenExecutor ):
241
241
future .result ()
242
242
# At some point, the executor should break
243
- t1 = time .time ()
243
+ t1 = time .monotonic ()
244
244
while not self .executor ._broken :
245
- if time .time () - t1 > 5 :
245
+ if time .monotonic () - t1 > 5 :
246
246
self .fail ("executor not broken after 5 s." )
247
247
time .sleep (0.01 )
248
248
# ... and from this point submit() is guaranteed to fail
You can’t perform that action at this time.
0 commit comments