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 Dec 27, 2023
1 parent da2e952 commit 75fa555
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/rs/core/src/sha.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// The sha of the commit that this version of crsqlite was built from.
pub const SHA: &'static str = "3a01980562615001d765eec61e3ed58147a93f93";
pub const SHA: &'static str = "da2e95270d76818cd487029ad3786e9463fa341b";
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 75fa555

Please sign in to comment.