77import time
88import unittest
99
10- from urllib3 .exceptions import MaxRetryError , ConnectTimeoutError , TimeoutError as Url3TimeoutError
10+ from urllib3 .exceptions import MaxRetryError , TimeoutError as Url3TimeoutError
1111
12- from influxdb_client_3 import InfluxDBClient3 , write_client_options , WriteOptions , SYNCHRONOUS , flight_client_options , \
12+ from influxdb_client_3 import InfluxDBClient3 , write_client_options , WriteOptions , \
1313 WriteType , InfluxDB3ClientQueryError
1414from influxdb_client_3 .exceptions import InfluxDBError
1515from tests .util import asyncio_run , lp_to_py_object
@@ -278,9 +278,8 @@ async def test_write_timeout_async(self):
278278 database = self .database ,
279279 token = self .token ,
280280 write_client_options = write_client_options (
281- # error_callback=set_error_record,
282281 write_options = WriteOptions (
283- max_retry_time = 0 , # disable retries
282+ max_retry_time = 0 , # disable retries
284283 timeout = 20 ,
285284 write_type = WriteType .asynchronous
286285 )
@@ -305,7 +304,7 @@ def set_error_result(rt, rd, rx):
305304 write_client_options = write_client_options (
306305 error_callback = set_error_result ,
307306 write_options = WriteOptions (
308- max_retry_time = 0 , # disable retries
307+ max_retry_time = 0 , # disable retries
309308 timeout = 20 ,
310309 write_type = WriteType .batching ,
311310 max_retries = 0 ,
@@ -330,11 +329,13 @@ def set_error_result(rt, rd, rx):
330329 def test_write_timeout_retry (self ):
331330
332331 ErrorResult = {"rt" : None , "rd" : None , "rx" : None }
332+
333333 def set_error_result (rt , rd , rx ):
334334 nonlocal ErrorResult
335335 ErrorResult = {"rt" : rt , "rd" : rd , "rx" : rx }
336336
337337 retry_ct = 0
338+
338339 def retry_cb (args , data , excp ):
339340 nonlocal retry_ct
340341 retry_ct += 1
@@ -359,7 +360,7 @@ def retry_cb(args, data, excp):
359360
360361 lp = "test_write_timeout,location=harfa fVal=3.14,iVal=42i"
361362 localClient .write (lp )
362- time .sleep (1 ) # await all retries
363+ time .sleep (1 ) # await all retries
363364
364365 self .assertEqual (3 , retry_ct )
365366 self .assertEqual ((self .database , 'default' , 'ns' ), ErrorResult ["rt" ])
@@ -391,4 +392,3 @@ def test_query_timeout_per_call_override(self):
391392
392393 with self .assertRaisesRegex (InfluxDB3ClientQueryError , ".*Deadline Exceeded.*" ):
393394 localClient .query ("SELECT * FROM data" , timeout = 0.001 )
394-
0 commit comments