Skip to content

Commit a69b677

Browse files
authored
server: add replica frame counter test check (#1541)
1 parent 15dca45 commit a69b677

File tree

1 file changed

+32
-0
lines changed
  • libsql-server/tests/embedded_replica

1 file changed

+32
-0
lines changed

libsql-server/tests/embedded_replica/mod.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,38 @@ fn replicate_with_snapshots() {
757757

758758
assert_eq!(stat, 427);
759759

760+
db.sync().await.unwrap();
761+
762+
let conn = db.connect().unwrap();
763+
764+
let mut res = conn.query("select count(*) from test", ()).await.unwrap();
765+
assert_eq!(
766+
*res.next()
767+
.await
768+
.unwrap()
769+
.unwrap()
770+
.get_value(0)
771+
.unwrap()
772+
.as_integer()
773+
.unwrap(),
774+
ROW_COUNT
775+
);
776+
777+
let stats = client
778+
.get("http://primary:9090/v1/namespaces/default/stats")
779+
.await?
780+
.json_value()
781+
.await
782+
.unwrap();
783+
784+
let stat = stats
785+
.get("embedded_replica_frames_replicated")
786+
.unwrap()
787+
.as_u64()
788+
.unwrap();
789+
790+
assert_eq!(stat, 427);
791+
760792
Ok(())
761793
});
762794

0 commit comments

Comments
 (0)