Skip to content

Commit bacc505

Browse files
committed
fixed tests
1 parent 83c806a commit bacc505

File tree

2 files changed

+11
-21
lines changed

2 files changed

+11
-21
lines changed

tests/system/data/test_metrics_async.py

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ async def test_mutate_row(self, table, temp_rows, handler, cluster_config):
263263
attempt.gfe_latency_ns > 0 and attempt.gfe_latency_ns < attempt.duration_ns
264264
)
265265
assert attempt.application_blocking_time_ns == 0
266-
assert attempt.grpc_throttling_time_ns == 0 # TODO: confirm
267266

268267
@CrossSync.pytest
269268
async def test_mutate_row_failure_with_retries(
@@ -338,7 +337,7 @@ async def test_mutate_row_failure_timeout(self, table, temp_rows, handler):
338337
assert operation.op_type.value == "MutateRow"
339338
assert operation.is_streaming is False
340339
assert len(operation.completed_attempts) == 1
341-
assert operation.cluster_id == "unspecified"
340+
assert operation.cluster_id == "<unspecified>"
342341
assert operation.zone == "global"
343342
# validate attempt
344343
attempt = handler.completed_attempts[0]
@@ -458,7 +457,6 @@ async def test_sample_row_keys(self, table, temp_rows, handler, cluster_config):
458457
attempt.gfe_latency_ns > 0 and attempt.gfe_latency_ns < attempt.duration_ns
459458
)
460459
assert attempt.application_blocking_time_ns == 0
461-
assert attempt.grpc_throttling_time_ns == 0 # TODO: confirm
462460

463461
@CrossSync.drop
464462
@CrossSync.pytest
@@ -488,7 +486,7 @@ async def test_sample_row_keys_failure_cancelled(
488486
assert operation.is_streaming is False
489487
assert len(operation.completed_attempts) == num_retryable + 1
490488
assert operation.completed_attempts[0] == handler.completed_attempts[0]
491-
assert operation.cluster_id == "unspecified"
489+
assert operation.cluster_id == "<unspecified>"
492490
assert operation.zone == "global"
493491
# validate attempts
494492
for i in range(num_retryable):
@@ -562,7 +560,7 @@ async def test_sample_row_keys_failure_timeout(self, table, handler):
562560
assert operation.op_type.value == "SampleRowKeys"
563561
assert operation.is_streaming is False
564562
assert len(operation.completed_attempts) == 1
565-
assert operation.cluster_id == "unspecified"
563+
assert operation.cluster_id == "<unspecified>"
566564
assert operation.zone == "global"
567565
# validate attempt
568566
attempt = handler.completed_attempts[0]
@@ -639,7 +637,6 @@ async def test_read_modify_write(self, table, temp_rows, handler, cluster_config
639637
attempt.gfe_latency_ns > 0 and attempt.gfe_latency_ns < attempt.duration_ns
640638
)
641639
assert attempt.application_blocking_time_ns == 0
642-
assert attempt.grpc_throttling_time_ns == 0 # TODO: confirm
643640

644641
@CrossSync.drop
645642
@CrossSync.pytest
@@ -676,7 +673,7 @@ async def test_read_modify_write_failure_cancelled(
676673
assert operation.op_type.value == "ReadModifyWriteRow"
677674
assert len(operation.completed_attempts) == len(handler.completed_attempts)
678675
assert operation.completed_attempts == handler.completed_attempts
679-
assert operation.cluster_id == "unspecified"
676+
assert operation.cluster_id == "<unspecified>"
680677
assert operation.zone == "global"
681678
assert operation.duration_ns > 0 and operation.duration_ns < 1e9
682679
assert (
@@ -691,7 +688,6 @@ async def test_read_modify_write_failure_cancelled(
691688
assert attempt.backoff_before_attempt_ns == 0
692689
assert attempt.gfe_latency_ns is None
693690
assert attempt.application_blocking_time_ns == 0
694-
assert attempt.grpc_throttling_time_ns == 0 # TODO: confirm
695691

696692
@CrossSync.pytest
697693
async def test_read_modify_write_failure_timeout(self, table, temp_rows, handler):
@@ -717,7 +713,7 @@ async def test_read_modify_write_failure_timeout(self, table, temp_rows, handler
717713
assert isinstance(operation, CompletedOperationMetric)
718714
assert operation.final_status.name == "DEADLINE_EXCEEDED"
719715
assert operation.op_type.value == "ReadModifyWriteRow"
720-
assert operation.cluster_id == "unspecified"
716+
assert operation.cluster_id == "<unspecified>"
721717
assert operation.zone == "global"
722718
# validate attempt
723719
attempt = handler.completed_attempts[0]
@@ -810,7 +806,6 @@ async def test_check_and_mutate_row(
810806
attempt.gfe_latency_ns > 0 and attempt.gfe_latency_ns < attempt.duration_ns
811807
)
812808
assert attempt.application_blocking_time_ns == 0
813-
assert attempt.grpc_throttling_time_ns == 0 # TODO: confirm
814809

815810
@CrossSync.drop
816811
@CrossSync.pytest
@@ -848,7 +843,7 @@ async def test_check_and_mutate_row_failure_cancelled(
848843
assert operation.op_type.value == "CheckAndMutateRow"
849844
assert len(operation.completed_attempts) == len(handler.completed_attempts)
850845
assert operation.completed_attempts == handler.completed_attempts
851-
assert operation.cluster_id == "unspecified"
846+
assert operation.cluster_id == "<unspecified>"
852847
assert operation.zone == "global"
853848
assert operation.duration_ns > 0 and operation.duration_ns < 1e9
854849
assert (
@@ -863,7 +858,6 @@ async def test_check_and_mutate_row_failure_cancelled(
863858
assert attempt.backoff_before_attempt_ns == 0
864859
assert attempt.gfe_latency_ns is None
865860
assert attempt.application_blocking_time_ns == 0
866-
assert attempt.grpc_throttling_time_ns == 0 # TODO: confirm
867861

868862
@CrossSync.pytest
869863
async def test_check_and_mutate_row_failure_timeout(
@@ -900,7 +894,7 @@ async def test_check_and_mutate_row_failure_timeout(
900894
operation = handler.completed_operations[0]
901895
assert isinstance(operation, CompletedOperationMetric)
902896
assert operation.final_status.name == "DEADLINE_EXCEEDED"
903-
assert operation.cluster_id == "unspecified"
897+
assert operation.cluster_id == "<unspecified>"
904898
assert operation.zone == "global"
905899
# validate attempt
906900
attempt = handler.completed_attempts[0]

tests/system/data/test_metrics_autogen.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ def test_mutate_row(self, table, temp_rows, handler, cluster_config):
217217
attempt.gfe_latency_ns > 0 and attempt.gfe_latency_ns < attempt.duration_ns
218218
)
219219
assert attempt.application_blocking_time_ns == 0
220-
assert attempt.grpc_throttling_time_ns == 0
221220

222221
def test_mutate_row_failure_with_retries(self, table, handler, error_injector):
223222
"""Test failure in grpc layer by injecting errors into an interceptor
@@ -277,7 +276,7 @@ def test_mutate_row_failure_timeout(self, table, temp_rows, handler):
277276
assert operation.op_type.value == "MutateRow"
278277
assert operation.is_streaming is False
279278
assert len(operation.completed_attempts) == 1
280-
assert operation.cluster_id == "unspecified"
279+
assert operation.cluster_id == "<unspecified>"
281280
assert operation.zone == "global"
282281
attempt = handler.completed_attempts[0]
283282
assert isinstance(attempt, CompletedAttemptMetric)
@@ -376,7 +375,6 @@ def test_sample_row_keys(self, table, temp_rows, handler, cluster_config):
376375
attempt.gfe_latency_ns > 0 and attempt.gfe_latency_ns < attempt.duration_ns
377376
)
378377
assert attempt.application_blocking_time_ns == 0
379-
assert attempt.grpc_throttling_time_ns == 0
380378

381379
def test_sample_row_keys_failure_with_retries(
382380
self, table, temp_rows, handler, error_injector, cluster_config
@@ -428,7 +426,7 @@ def test_sample_row_keys_failure_timeout(self, table, handler):
428426
assert operation.op_type.value == "SampleRowKeys"
429427
assert operation.is_streaming is False
430428
assert len(operation.completed_attempts) == 1
431-
assert operation.cluster_id == "unspecified"
429+
assert operation.cluster_id == "<unspecified>"
432430
assert operation.zone == "global"
433431
attempt = handler.completed_attempts[0]
434432
assert isinstance(attempt, CompletedAttemptMetric)
@@ -491,7 +489,6 @@ def test_read_modify_write(self, table, temp_rows, handler, cluster_config):
491489
attempt.gfe_latency_ns > 0 and attempt.gfe_latency_ns < attempt.duration_ns
492490
)
493491
assert attempt.application_blocking_time_ns == 0
494-
assert attempt.grpc_throttling_time_ns == 0
495492

496493
def test_read_modify_write_failure_timeout(self, table, temp_rows, handler):
497494
"""Test failure in gapic layer by passing very low timeout
@@ -512,7 +509,7 @@ def test_read_modify_write_failure_timeout(self, table, temp_rows, handler):
512509
assert isinstance(operation, CompletedOperationMetric)
513510
assert operation.final_status.name == "DEADLINE_EXCEEDED"
514511
assert operation.op_type.value == "ReadModifyWriteRow"
515-
assert operation.cluster_id == "unspecified"
512+
assert operation.cluster_id == "<unspecified>"
516513
assert operation.zone == "global"
517514
attempt = handler.completed_attempts[0]
518515
assert attempt.gfe_latency_ns is None
@@ -587,7 +584,6 @@ def test_check_and_mutate_row(self, table, temp_rows, handler, cluster_config):
587584
attempt.gfe_latency_ns > 0 and attempt.gfe_latency_ns < attempt.duration_ns
588585
)
589586
assert attempt.application_blocking_time_ns == 0
590-
assert attempt.grpc_throttling_time_ns == 0
591587

592588
def test_check_and_mutate_row_failure_timeout(self, table, temp_rows, handler):
593589
"""Test failure in gapic layer by passing very low timeout
@@ -616,7 +612,7 @@ def test_check_and_mutate_row_failure_timeout(self, table, temp_rows, handler):
616612
operation = handler.completed_operations[0]
617613
assert isinstance(operation, CompletedOperationMetric)
618614
assert operation.final_status.name == "DEADLINE_EXCEEDED"
619-
assert operation.cluster_id == "unspecified"
615+
assert operation.cluster_id == "<unspecified>"
620616
assert operation.zone == "global"
621617
attempt = handler.completed_attempts[0]
622618
assert attempt.gfe_latency_ns is None

0 commit comments

Comments
 (0)