add check to python tests that afteer gc number of rows is unchanged in all branches

This commit is contained in:
Dmitry Rodionov
2021-11-18 14:47:12 +03:00
committed by Dmitry Rodionov
parent 6f7ebe6e01
commit 737a557f09

View File

@@ -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, )