Skip to content

Commit

Permalink
extra tests for the tie break merge option
Browse files Browse the repository at this point in the history
  • Loading branch information
tantaman committed Jan 6, 2024
1 parent cfc2d58 commit 3a39098
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions py/correctness/tests/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,14 @@ def test_merge_same_w_tie_breaker():
changes21 = db1.execute("SELECT \"table\", pk, cid, val, col_version, site_id FROM crsql_changes").fetchall()

assert (changes12 == changes21)
# Test that we're stable / do not loop when we tie break equal values

sync_left_to_right(db1, db2, 0)
changes12_2 = db2.execute("SELECT \"table\", pk, cid, val, col_version, site_id FROM crsql_changes").fetchall()
sync_left_to_right(db2, db1, 0)
changes21_2 = db1.execute("SELECT \"table\", pk, cid, val, col_version, site_id FROM crsql_changes").fetchall()
assert (changes12_2 == changes21)
assert (changes12 == changes21_2)


def test_merge_matching_clocks_lesser_value():
Expand Down

0 comments on commit 3a39098

Please sign in to comment.