2626except :
2727 print ("no urllib3" )
2828
29+ SPLIT_TIMEOUT = 60 * 25 # timeout test at 25 minutes
30+ SLEEP_TIME = 60 # sleep for 1 minutes
2931
3032class TestConfig (object ):
3133 local_host = 'https://localhost:8081/'
@@ -204,19 +206,19 @@ async def _validate_offset_limit(cls, created_collection, query, results):
204206 def trigger_split (container , throughput ):
205207 print ("Triggering a split in session token helpers" )
206208 container .replace_throughput (throughput )
207- print ("changed offer to 11k " )
209+ print (f "changed offer to { throughput } " )
208210 print ("--------------------------------" )
209211 print ("Waiting for split to complete" )
210212 start_time = time .time ()
211213
212214 while True :
213215 offer = container .get_throughput ()
214216 if offer .properties ['content' ].get ('isOfferReplacePending' , False ):
215- if time .time () - start_time > 60 * 25 : # timeout test at 25 minutes
216- unittest .skip ("Partition split didn't complete in time. " )
217+ if time .time () - start_time > SPLIT_TIMEOUT : # timeout test at 25 minutes
218+ raise unittest .SkipTest ("Partition split didn't complete in time" )
217219 else :
218220 print ("Waiting for split to complete" )
219- time .sleep (60 )
221+ time .sleep (SLEEP_TIME )
220222 else :
221223 break
222224 print ("Split in session token helpers has completed" )
@@ -225,19 +227,19 @@ def trigger_split(container, throughput):
225227 async def trigger_split_async (container , throughput ):
226228 print ("Triggering a split in session token helpers" )
227229 await container .replace_throughput (throughput )
228- print ("changed offer to 11k " )
230+ print (f "changed offer to { throughput } " )
229231 print ("--------------------------------" )
230232 print ("Waiting for split to complete" )
231233 start_time = time .time ()
232234
233235 while True :
234236 offer = await container .get_throughput ()
235237 if offer .properties ['content' ].get ('isOfferReplacePending' , False ):
236- if time .time () - start_time > 60 * 25 : # timeout test at 25 minutes
237- unittest .skip ("Partition split didn't complete in time. " )
238+ if time .time () - start_time > SPLIT_TIMEOUT : # timeout test at 25 minutes
239+ raise unittest .SkipTest ("Partition split didn't complete in time" )
238240 else :
239241 print ("Waiting for split to complete" )
240- time .sleep (60 )
242+ time .sleep (SLEEP_TIME )
241243 else :
242244 break
243245 print ("Split in session token helpers has completed" )
0 commit comments