Skip to content

Commit 2cf3494

Browse files
committed
tests: Add checks for max_write_replication_index
Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
1 parent 75d04cf commit 2cf3494

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • libsql-server/tests/embedded_replica

libsql-server/tests/embedded_replica/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ fn execute_batch() {
179179
conn.execute("CREATE TABLE user (id INTEGER NOT NULL PRIMARY KEY)", ())
180180
.await?;
181181

182+
assert_eq!(db.max_write_replication_index(), Some(1));
183+
182184
let n = db.sync().await?.frame_no();
183185
assert_eq!(n, Some(1));
184186

@@ -231,6 +233,7 @@ fn stream() {
231233

232234
conn.execute("CREATE TABLE user (id INTEGER NOT NULL PRIMARY KEY)", ())
233235
.await?;
236+
assert_eq!(db.max_write_replication_index(), Some(1));
234237

235238
let n = db.sync().await?.frame_no();
236239
assert_eq!(n, Some(1));
@@ -244,8 +247,10 @@ fn stream() {
244247
",
245248
)
246249
.await?;
250+
let replication_index = db.max_write_replication_index();
247251

248-
db.sync().await.unwrap();
252+
let synced_replication_index = db.sync().await.unwrap().frame_no();
253+
assert_eq!(synced_replication_index, replication_index);
249254

250255
let rows = conn.query("select * from user", ()).await.unwrap();
251256

0 commit comments

Comments
 (0)