Skip to content

Commit aa12ad5

Browse files
authored
quota tool has been fixed (#13046)
1 parent b9e3013 commit aa12ad5

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

ydb/tests/tools/fq_runner/kikimr_runner.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@
3131
logging.getLogger("library.python.retry").setLevel("ERROR")
3232

3333

34+
def plain_or_under_sanitizer_wrapper(plain, sanitized):
35+
try:
36+
return plain_or_under_sanitizer(plain, sanitized)
37+
except Exception:
38+
return plain
39+
40+
3441
class BaseTenant(abc.ABC):
3542
def __init__(
3643
self,
@@ -215,14 +222,14 @@ def get_worker_count(self, node_index):
215222
{"subsystem": "worker_manager", "sensor": "ActiveWorkers"})
216223
return result if result is not None else 0
217224

218-
def wait_worker_count(self, node_index, activity, expected_count, timeout=plain_or_under_sanitizer(30, 150)):
225+
def wait_worker_count(self, node_index, activity, expected_count, timeout=plain_or_under_sanitizer_wrapper(30, 150)):
219226
deadline = time.time() + timeout
220227
while True:
221228
count = self.get_actor_count(node_index, activity)
222229
if count >= expected_count:
223230
break
224231
assert time.time() < deadline, "Wait actor count failed"
225-
time.sleep(plain_or_under_sanitizer(0.5, 2))
232+
time.sleep(plain_or_under_sanitizer_wrapper(0.5, 2))
226233
pass
227234

228235
def get_mkql_limit(self, node_index):
@@ -267,7 +274,7 @@ def ensure_is_alive(self):
267274
self.wait_bootstrap(n)
268275
assert self.get_actor_count(n, "GRPC_PROXY") > 0, "Node {} died".format(n)
269276

270-
def wait_bootstrap(self, node_index=None, wait_time=plain_or_under_sanitizer(90, 400)):
277+
def wait_bootstrap(self, node_index=None, wait_time=plain_or_under_sanitizer_wrapper(90, 400)):
271278
if node_index is None:
272279
for n in self.kikimr_cluster.nodes:
273280
self.wait_bootstrap(n, wait_time)
@@ -280,13 +287,13 @@ def wait_bootstrap(self, node_index=None, wait_time=plain_or_under_sanitizer(90,
280287
if self.get_actor_count(node_index, "GRPC_PROXY") == 0:
281288
continue
282289
except Exception:
283-
time.sleep(plain_or_under_sanitizer(0.3, 2))
290+
time.sleep(plain_or_under_sanitizer_wrapper(0.3, 2))
284291
continue
285292
break
286293
self.bootstraped_nodes.add(node_index)
287294
logging.debug("Node {} has been bootstrapped".format(node_index))
288295

289-
def wait_discovery(self, node_index=None, wait_time=plain_or_under_sanitizer(30, 150)):
296+
def wait_discovery(self, node_index=None, wait_time=plain_or_under_sanitizer_wrapper(30, 150)):
290297
if node_index is None:
291298
for n in self.kikimr_cluster.nodes:
292299
self.wait_discovery(n, wait_time)
@@ -301,12 +308,12 @@ def wait_discovery(self, node_index=None, wait_time=plain_or_under_sanitizer(30,
301308
if peer_count is None or peer_count < self.node_count:
302309
continue
303310
except Exception:
304-
time.sleep(plain_or_under_sanitizer(0.3, 2))
311+
time.sleep(plain_or_under_sanitizer_wrapper(0.3, 2))
305312
continue
306313
break
307314
logging.debug("Node {} discovery finished".format(node_index))
308315

309-
def wait_workers(self, worker_count, wait_time=plain_or_under_sanitizer(30, 150)):
316+
def wait_workers(self, worker_count, wait_time=plain_or_under_sanitizer_wrapper(30, 150)):
310317
ca_count = worker_count * 2 # we count 2x CAs
311318
deadline = time.time() + wait_time
312319
while True:
@@ -357,17 +364,17 @@ def get_completed_checkpoints(self, query_id, expect_counters_exist=False):
357364
expect_counters_exist=expect_counters_exist)
358365

359366
def wait_completed_checkpoints(self, query_id, checkpoints_count,
360-
timeout=plain_or_under_sanitizer(30, 150),
367+
timeout=plain_or_under_sanitizer_wrapper(30, 150),
361368
expect_counters_exist=False):
362369
deadline = time.time() + timeout
363370
while True:
364371
completed = self.get_completed_checkpoints(query_id, expect_counters_exist=expect_counters_exist)
365372
if completed >= checkpoints_count:
366373
break
367374
assert time.time() < deadline, "Wait zero checkpoint failed, actual completed: " + str(completed)
368-
time.sleep(plain_or_under_sanitizer(0.5, 2))
375+
time.sleep(plain_or_under_sanitizer_wrapper(0.5, 2))
369376

370-
def wait_zero_checkpoint(self, query_id, timeout=plain_or_under_sanitizer(30, 150),
377+
def wait_zero_checkpoint(self, query_id, timeout=plain_or_under_sanitizer_wrapper(30, 150),
371378
expect_counters_exist=False):
372379
self.wait_completed_checkpoints(query_id, 1, timeout, expect_counters_exist)
373380

0 commit comments

Comments
 (0)