Skip to content

Commit a773dee

Browse files
committed
tests: add sync test to start from checkpoint uuid
Signed-off-by: Abhinav Gyawali <22275402+abhizer@users.noreply.github.com>
1 parent 528c4ff commit a773dee

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

python/tests/test_shared_pipeline1.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def storage_cfg(
3636

3737
class TestCheckpointSync(SharedTestPipeline):
3838
@enterprise_only
39-
def test_checkpoint_sync(self, auth_err: bool = False):
39+
def test_checkpoint_sync(self, from_uuid: bool = False, auth_err: bool = False):
4040
"""
4141
CREATE TABLE t0 (c0 INT, c1 VARCHAR);
4242
CREATE MATERIALIZED VIEW v0 AS SELECT c0 FROM t0;
@@ -53,13 +53,15 @@ def test_checkpoint_sync(self, auth_err: bool = False):
5353
got_before = list(self.pipeline.query("SELECT * FROM v0"))
5454

5555
self.pipeline.checkpoint(wait=True)
56-
self.pipeline.sync_checkpoint(wait=True)
56+
uuid = self.pipeline.sync_checkpoint(wait=True)
5757

5858
self.pipeline.stop(force=True)
5959
self.pipeline.clear_storage()
6060

6161
# Restart pipeline from checkpoint
62-
storage_config = storage_cfg(start_from_checkpoint="latest", auth_err=auth_err)
62+
storage_config = storage_cfg(
63+
start_from_checkpoint=uuid if from_uuid else "latest", auth_err=auth_err
64+
)
6365
self.set_runtime_config(RuntimeConfig(storage=Storage(config=storage_config)))
6466
self.pipeline.start()
6567
got_after = list(self.pipeline.query("SELECT * FROM v0"))
@@ -69,6 +71,10 @@ def test_checkpoint_sync(self, auth_err: bool = False):
6971
self.pipeline.stop(force=True)
7072
self.pipeline.clear_storage()
7173

74+
@enterprise_only
75+
def test_checkpoint_sync_from_uuid(self):
76+
self.test_checkpoint_sync(from_uuid=True)
77+
7278
@enterprise_only
7379
def test_checkpoint_sync_err(self):
7480
with self.assertRaisesRegex(RuntimeError, "SignatureDoesNotMatch"):

0 commit comments

Comments
 (0)