@@ -490,7 +490,7 @@ def cycle_batch_writer_check(raw_table, encrypted_table, initial_actions, initia
490
490
491
491
ddb_keys = [key for key in TEST_BATCH_KEYS ]
492
492
encrypted_items = [
493
- raw_table .get_item (Key = key )['Item' ]
493
+ raw_table .get_item (Key = key , ConsistentRead = True )['Item' ]
494
494
for key in ddb_keys
495
495
]
496
496
check_many_encrypted_items (
@@ -501,7 +501,7 @@ def cycle_batch_writer_check(raw_table, encrypted_table, initial_actions, initia
501
501
)
502
502
503
503
decrypted_result = [
504
- encrypted_table .get_item (Key = key )['Item' ]
504
+ encrypted_table .get_item (Key = key , ConsistentRead = True )['Item' ]
505
505
for key in ddb_keys
506
506
]
507
507
assert_equal_lists_of_items (
@@ -549,10 +549,10 @@ def table_cycle_check(materials_provider, initial_actions, initial_item, table_n
549
549
550
550
_put_result = e_table .put_item (Item = item ) # noqa
551
551
552
- encrypted_result = table .get_item (Key = TEST_KEY )
552
+ encrypted_result = table .get_item (Key = TEST_KEY , ConsistentRead = True )
553
553
check_encrypted_item (item , encrypted_result ['Item' ], check_attribute_actions )
554
554
555
- decrypted_result = e_table .get_item (Key = TEST_KEY )
555
+ decrypted_result = e_table .get_item (Key = TEST_KEY , ConsistentRead = True )
556
556
assert decrypted_result ['Item' ] == item
557
557
558
558
e_table .delete_item (Key = TEST_KEY )
@@ -593,8 +593,8 @@ def resource_cycle_batch_items_check(materials_provider, initial_actions, initia
593
593
table_name = table_name
594
594
)
595
595
596
- raw_scan_result = resource .Table (table_name ).scan ()
597
- e_scan_result = e_resource .Table (table_name ).scan ()
596
+ raw_scan_result = resource .Table (table_name ).scan (ConsistentRead = True )
597
+ e_scan_result = e_resource .Table (table_name ).scan (ConsistentRead = True )
598
598
assert not raw_scan_result ['Items' ]
599
599
assert not e_scan_result ['Items' ]
600
600
@@ -624,13 +624,15 @@ def client_cycle_single_item_check(materials_provider, initial_actions, initial_
624
624
625
625
encrypted_result = client .get_item (
626
626
TableName = table_name ,
627
- Key = ddb_key
627
+ Key = ddb_key ,
628
+ ConsistentRead = True
628
629
)
629
630
check_encrypted_item (item , ddb_to_dict (encrypted_result ['Item' ]), check_attribute_actions )
630
631
631
632
decrypted_result = e_client .get_item (
632
633
TableName = table_name ,
633
- Key = ddb_key
634
+ Key = ddb_key ,
635
+ ConsistentRead = True
634
636
)
635
637
assert ddb_to_dict (decrypted_result ['Item' ]) == item
636
638
@@ -663,8 +665,8 @@ def client_cycle_batch_items_check(materials_provider, initial_actions, initial_
663
665
table_name = table_name
664
666
)
665
667
666
- raw_scan_result = client .scan (TableName = table_name )
667
- e_scan_result = e_client .scan (TableName = table_name )
668
+ raw_scan_result = client .scan (TableName = table_name , ConsistentRead = True )
669
+ e_scan_result = e_client .scan (TableName = table_name , ConsistentRead = True )
668
670
assert not raw_scan_result ['Items' ]
669
671
assert not e_scan_result ['Items' ]
670
672
@@ -699,12 +701,12 @@ def client_cycle_batch_items_check_paginators(
699
701
700
702
encrypted_items = []
701
703
raw_paginator = client .get_paginator ('scan' )
702
- for page in raw_paginator .paginate (TableName = table_name ):
704
+ for page in raw_paginator .paginate (TableName = table_name , ConsistentRead = True ):
703
705
encrypted_items .extend (page ['Items' ])
704
706
705
707
decrypted_items = []
706
708
encrypted_paginator = e_client .get_paginator ('scan' )
707
- for page in encrypted_paginator .paginate (TableName = table_name ):
709
+ for page in encrypted_paginator .paginate (TableName = table_name , ConsistentRead = True ):
708
710
decrypted_items .extend (page ['Items' ])
709
711
710
712
print (encrypted_items )
@@ -725,7 +727,7 @@ def client_cycle_batch_items_check_paginators(
725
727
table_name = table_name
726
728
)
727
729
728
- raw_scan_result = client .scan (TableName = table_name )
729
- e_scan_result = e_client .scan (TableName = table_name )
730
+ raw_scan_result = client .scan (TableName = table_name , ConsistentRead = True )
731
+ e_scan_result = e_client .scan (TableName = table_name , ConsistentRead = True )
730
732
assert not raw_scan_result ['Items' ]
731
733
assert not e_scan_result ['Items' ]
0 commit comments