From 737a557f09fe817154e529cf85eba0dc937d88e0 Mon Sep 17 00:00:00 2001 From: Dmitry Rodionov Date: Thu, 18 Nov 2021 14:47:12 +0300 Subject: [PATCH] add check to python tests that afteer gc number of rows is unchanged in all branches --- test_runner/batch_others/test_branch_behind.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test_runner/batch_others/test_branch_behind.py b/test_runner/batch_others/test_branch_behind.py index 9e38b990ea..5ccb714c05 100644 --- a/test_runner/batch_others/test_branch_behind.py +++ b/test_runner/batch_others/test_branch_behind.py @@ -119,3 +119,13 @@ def test_branch_behind(zenith_simple_env: ZenithEnv): with pytest.raises(Exception, match="(we might've already garbage collected needed data)"): # this gced_lsn is pretty random, so if gc is disabled this woudln't fail env.zenith_cli(["branch", "test_branch_create_fail", f"test_branch_behind@{gced_lsn}"]) + + # check that after gc everything is still there + hundred_cur.execute('SELECT count(*) FROM foo') + assert hundred_cur.fetchone() == (100, ) + + more_cur.execute('SELECT count(*) FROM foo') + assert more_cur.fetchone() == (200100, ) + + main_cur.execute('SELECT count(*) FROM foo') + assert main_cur.fetchone() == (400100, )