@@ -589,6 +589,43 @@ def test_multiuse_snapshot_read_isolation_strong(self):
589
589
after = list (strong .read (self .TABLE , self .COLUMNS , self .ALL ))
590
590
self ._check_row_data (after , all_data_rows )
591
591
592
+ def test_multiuse_snapshot_read_isolation_read_timestamp (self ):
593
+ ROW_COUNT = 40
594
+ session , committed = self ._set_up_table (ROW_COUNT )
595
+ all_data_rows = list (self ._row_data (ROW_COUNT ))
596
+ read_ts = session .snapshot (read_timestamp = committed , multi_use = True )
597
+
598
+ before = list (read_ts .read (self .TABLE , self .COLUMNS , self .ALL ))
599
+ self ._check_row_data (before , all_data_rows )
600
+
601
+ with self ._db .batch () as batch :
602
+ batch .delete (self .TABLE , self .ALL )
603
+
604
+ after = list (read_ts .read (self .TABLE , self .COLUMNS , self .ALL ))
605
+ self ._check_row_data (after , all_data_rows )
606
+
607
+ def test_multiuse_snapshot_read_isolation_exact_staleness (self ):
608
+ import time
609
+ from datetime import timedelta
610
+ ROW_COUNT = 40
611
+
612
+ session , committed = self ._set_up_table (ROW_COUNT )
613
+ all_data_rows = list (self ._row_data (ROW_COUNT ))
614
+
615
+ time .sleep (1 )
616
+ delta = timedelta (microseconds = 1000 )
617
+
618
+ exact = session .snapshot (exact_staleness = delta , multi_use = True )
619
+
620
+ before = list (exact .read (self .TABLE , self .COLUMNS , self .ALL ))
621
+ self ._check_row_data (before , all_data_rows )
622
+
623
+ with self ._db .batch () as batch :
624
+ batch .delete (self .TABLE , self .ALL )
625
+
626
+ after = list (exact .read (self .TABLE , self .COLUMNS , self .ALL ))
627
+ self ._check_row_data (after , all_data_rows )
628
+
592
629
def test_read_w_manual_consume (self ):
593
630
ROW_COUNT = 4000
594
631
session , committed = self ._set_up_table (ROW_COUNT )
0 commit comments