Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit eb8a229

Browse files
committed
added stubs
1 parent 66d3254 commit eb8a229

1 file changed

Lines changed: 308 additions & 1 deletion

File tree

tests/system/data/test_metrics_async.py

Lines changed: 308 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,35 @@ async def test_read_rows(self, table, temp_rows, handler, cluster_config):
180180
assert attempt.application_blocking_time_ns > 0 and attempt.application_blocking_time_ns < operation.duration_ns
181181
assert attempt.grpc_throttling_time_ns == 0 # TODO: confirm
182182

183+
@CrossSync.pytest
184+
async def test_read_rows_failure_grpc(
185+
self, table, temp_rows, handler, error_injector
186+
):
187+
"""
188+
Test failure in grpc layer by injecting an error into an interceptor
189+
190+
No headers expected
191+
"""
192+
pass
193+
194+
@CrossSync.pytest
195+
async def test_read_rows_failure_timeout(self, table, temp_rows, handler):
196+
"""
197+
Test failure in gapic layer by passing very low timeout
198+
199+
No grpc headers expected
200+
"""
201+
pass
202+
203+
@CrossSync.pytest
204+
async def test_read_rows_failure_unauthorized(
205+
self, handler, authorized_view, cluster_config
206+
):
207+
"""
208+
Test failure in backend by accessing an unauthorized family
209+
"""
210+
pass
211+
183212
@CrossSync.pytest
184213
async def test_read_rows_stream(self, table, temp_rows, handler, cluster_config):
185214
await temp_rows.add_row(b"row_key_1")
@@ -216,6 +245,46 @@ async def test_read_rows_stream(self, table, temp_rows, handler, cluster_config)
216245
assert attempt.application_blocking_time_ns > 0 and attempt.application_blocking_time_ns < operation.duration_ns
217246
assert attempt.grpc_throttling_time_ns == 0 # TODO: confirm
218247

248+
@CrossSync.pytest
249+
async def test_read_rows_stream_failure_grpc(
250+
self, table, temp_rows, handler, error_injector
251+
):
252+
"""
253+
Test failure in grpc layer by injecting an error into an interceptor
254+
255+
No headers expected
256+
"""
257+
pass
258+
259+
@CrossSync.pytest
260+
async def test_read_rows_stream_failure_timeout(
261+
self, table, temp_rows, handler
262+
):
263+
"""
264+
Test failure in gapic layer by passing very low timeout
265+
266+
No grpc headers expected
267+
"""
268+
pass
269+
270+
@CrossSync.pytest
271+
async def test_read_rows_stream_failure_unauthorized(
272+
self, handler, authorized_view, cluster_config
273+
):
274+
"""
275+
Test failure in backend by accessing an unauthorized family
276+
"""
277+
pass
278+
279+
@CrossSync.pytest
280+
async def test_read_rows_stream_failure_mid_stream(
281+
self, table, temp_rows, handler, error_injector
282+
):
283+
"""
284+
Test failure in grpc stream
285+
"""
286+
pass
287+
219288
@CrossSync.pytest
220289
async def test_read_row(self, table, temp_rows, handler, cluster_config):
221290
await temp_rows.add_row(b"row_key_1")
@@ -248,6 +317,35 @@ async def test_read_row(self, table, temp_rows, handler, cluster_config):
248317
assert attempt.application_blocking_time_ns > 0 and attempt.application_blocking_time_ns < operation.duration_ns
249318
assert attempt.grpc_throttling_time_ns == 0 # TODO: confirm
250319

320+
@CrossSync.pytest
321+
async def test_read_row_failure_grpc(
322+
self, table, temp_rows, handler, error_injector
323+
):
324+
"""
325+
Test failure in grpc layer by injecting an error into an interceptor
326+
327+
No headers expected
328+
"""
329+
pass
330+
331+
@CrossSync.pytest
332+
async def test_read_row_failure_timeout(self, table, temp_rows, handler):
333+
"""
334+
Test failure in gapic layer by passing very low timeout
335+
336+
No grpc headers expected
337+
"""
338+
pass
339+
340+
@CrossSync.pytest
341+
async def test_read_row_failure_unauthorized(
342+
self, handler, authorized_view, cluster_config
343+
):
344+
"""
345+
Test failure in backend by accessing an unauthorized family
346+
"""
347+
pass
348+
251349
@CrossSync.pytest
252350
async def test_read_rows_sharded(self, table, temp_rows, handler, cluster_config):
253351
from google.cloud.bigtable.data.read_rows_query import ReadRowsQuery
@@ -287,6 +385,46 @@ async def test_read_rows_sharded(self, table, temp_rows, handler, cluster_config
287385
assert attempt.application_blocking_time_ns > 0 and attempt.application_blocking_time_ns < operation.duration_ns
288386
assert attempt.grpc_throttling_time_ns == 0 # TODO: confirm
289387

388+
@CrossSync.pytest
389+
async def test_read_rows_sharded_failure_grpc(
390+
self, table, temp_rows, handler, error_injector
391+
):
392+
"""
393+
Test failure in grpc layer by injecting an error into an interceptor
394+
395+
No headers expected
396+
"""
397+
pass
398+
399+
@CrossSync.pytest
400+
async def test_read_rows_sharded_failure_timeout(
401+
self, table, temp_rows, handler
402+
):
403+
"""
404+
Test failure in gapic layer by passing very low timeout
405+
406+
No grpc headers expected
407+
"""
408+
pass
409+
410+
@CrossSync.pytest
411+
async def test_read_rows_sharded_failure_unauthorized(
412+
self, handler, authorized_view, cluster_config
413+
):
414+
"""
415+
Test failure in backend by accessing an unauthorized family
416+
"""
417+
pass
418+
419+
@CrossSync.pytest
420+
async def test_read_rows_sharded_failure_mid_stream(
421+
self, table, temp_rows, handler, error_injector
422+
):
423+
"""
424+
Test failure in grpc stream
425+
"""
426+
pass
427+
290428
@CrossSync.pytest
291429
async def test_bulk_mutate_rows(self, table, temp_rows, handler, cluster_config):
292430
from google.cloud.bigtable.data.mutations import RowMutationEntry
@@ -326,6 +464,37 @@ async def test_bulk_mutate_rows(self, table, temp_rows, handler, cluster_config)
326464
assert attempt.application_blocking_time_ns == 0
327465
assert attempt.grpc_throttling_time_ns == 0 # TODO: confirm
328466

467+
@CrossSync.pytest
468+
async def test_bulk_mutate_rows_failure_grpc(
469+
self, table, temp_rows, handler, error_injector
470+
):
471+
"""
472+
Test failure in grpc layer by injecting an error into an interceptor
473+
474+
No headers expected
475+
"""
476+
pass
477+
478+
@CrossSync.pytest
479+
async def test_bulk_mutate_rows_failure_timeout(
480+
self, table, temp_rows, handler
481+
):
482+
"""
483+
Test failure in gapic layer by passing very low timeout
484+
485+
No grpc headers expected
486+
"""
487+
pass
488+
489+
@CrossSync.pytest
490+
async def test_bulk_mutate_rows_failure_unauthorized(
491+
self, handler, authorized_view, cluster_config
492+
):
493+
"""
494+
Test failure in backend by accessing an unauthorized family
495+
"""
496+
pass
497+
329498
@CrossSync.pytest
330499
async def test_mutate_rows_batcher(self, table, temp_rows, handler, cluster_config):
331500
from google.cloud.bigtable.data.mutations import RowMutationEntry
@@ -376,9 +545,40 @@ async def test_mutate_rows_batcher(self, table, temp_rows, handler, cluster_conf
376545
assert attempt.application_blocking_time_ns == 0
377546
assert attempt.grpc_throttling_time_ns == 0 # TODO: confirm
378547

548+
@CrossSync.pytest
549+
async def test_mutate_rows_batcher_failure_grpc(
550+
self, table, temp_rows, handler, error_injector
551+
):
552+
"""
553+
Test failure in grpc layer by injecting an error into an interceptor
554+
555+
No headers expected
556+
"""
557+
pass
558+
559+
@CrossSync.pytest
560+
async def test_mutate_rows_batcher_failure_timeout(
561+
self, table, temp_rows, handler
562+
):
563+
"""
564+
Test failure in gapic layer by passing very low timeout
565+
566+
No grpc headers expected
567+
"""
568+
pass
569+
570+
@CrossSync.pytest
571+
async def test_mutate_rows_batcher_failure_unauthorized(
572+
self, handler, authorized_view, cluster_config
573+
):
574+
"""
575+
Test failure in backend by accessing an unauthorized family
576+
"""
577+
pass
578+
379579
@CrossSync.pytest
380580
async def test_mutate_row(self, table, temp_rows, handler, cluster_config):
381-
row_key = b"bulk_mutate"
581+
row_key = b"mutate"
382582
new_value = uuid.uuid4().hex.encode()
383583
row_key, mutation = await temp_rows.create_row_and_mutation(
384584
table, new_value=new_value
@@ -412,6 +612,38 @@ async def test_mutate_row(self, table, temp_rows, handler, cluster_config):
412612
assert attempt.application_blocking_time_ns == 0
413613
assert attempt.grpc_throttling_time_ns == 0 # TODO: confirm
414614

615+
@CrossSync.pytest
616+
async def test_mutate_row_failure_grpc(
617+
self, table, temp_rows, handler, error_injector
618+
):
619+
"""
620+
Test failure in grpc layer by injecting an error into an interceptor
621+
622+
No headers expected
623+
"""
624+
pass
625+
626+
627+
@CrossSync.pytest
628+
async def test_mutate_row_failure_timeout(
629+
self, table, temp_rows, handler
630+
):
631+
"""
632+
Test failure in gapic layer by passing very low timeout
633+
634+
No grpc headers expected
635+
"""
636+
pass
637+
638+
@CrossSync.pytest
639+
async def test_mutate_row_failure_unauthorized(
640+
self, handler, authorized_view, cluster_config
641+
):
642+
"""
643+
Test failure in backend by accessing an unauthorized family
644+
"""
645+
pass
646+
415647
@CrossSync.pytest
416648
async def test_sample_row_keys(self, table, temp_rows, handler, cluster_config):
417649
await table.sample_row_keys()
@@ -442,6 +674,48 @@ async def test_sample_row_keys(self, table, temp_rows, handler, cluster_config):
442674
assert attempt.application_blocking_time_ns == 0
443675
assert attempt.grpc_throttling_time_ns == 0 # TODO: confirm
444676

677+
@CrossSync.pytest
678+
async def test_sample_row_keys_failure_grpc(
679+
self, table, temp_rows, handler, error_injector
680+
):
681+
"""
682+
Test failure in grpc layer by injecting an error into an interceptor
683+
684+
No headers expected
685+
"""
686+
pass
687+
688+
689+
@CrossSync.pytest
690+
async def test_sample_row_keys_failure_timeout(
691+
self, table, temp_rows, handler
692+
):
693+
"""
694+
Test failure in gapic layer by passing very low timeout
695+
696+
No grpc headers expected
697+
"""
698+
pass
699+
700+
@CrossSync.pytest
701+
async def test_sample_row_keys_failure_unauthorized(
702+
self, handler, authorized_view, cluster_config
703+
):
704+
"""
705+
Test failure in backend by accessing an unauthorized family
706+
"""
707+
pass
708+
709+
@CrossSync.pytest
710+
async def test_sample_row_keys_failure_mid_stream(
711+
self, table, temp_rows, handler, error_injector
712+
):
713+
"""
714+
Test failure in grpc stream
715+
"""
716+
pass
717+
718+
445719
@CrossSync.pytest
446720
async def test_read_modify_write(self, table, temp_rows, handler, cluster_config):
447721
from google.cloud.bigtable.data.read_modify_write_rules import IncrementRule
@@ -481,6 +755,39 @@ async def test_read_modify_write(self, table, temp_rows, handler, cluster_config
481755
assert attempt.application_blocking_time_ns == 0
482756
assert attempt.grpc_throttling_time_ns == 0 # TODO: confirm
483757

758+
@CrossSync.pytest
759+
async def test_read_modify_write_row_failure_grpc(
760+
self, table, temp_rows, handler, error_injector
761+
):
762+
"""
763+
Test failure in grpc layer by injecting an error into an interceptor
764+
765+
No headers expected
766+
"""
767+
pass
768+
769+
770+
@CrossSync.pytest
771+
async def test_read_modify_write_row_failure_timeout(
772+
self, table, temp_rows, handler
773+
):
774+
"""
775+
Test failure in gapic layer by passing very low timeout
776+
777+
No grpc headers expected
778+
"""
779+
pass
780+
781+
@CrossSync.pytest
782+
async def test_read_modify_write_row_failure_unauthorized(
783+
self, handler, authorized_view, cluster_config
784+
):
785+
"""
786+
Test failure in backend by accessing an unauthorized family
787+
"""
788+
pass
789+
790+
484791
@CrossSync.pytest
485792
async def test_check_and_mutate_row(self, table, temp_rows, handler, cluster_config):
486793
from google.cloud.bigtable.data.mutations import SetCell

0 commit comments

Comments
 (0)