Skip to content

Commit

Permalink
test: fix test_status
Browse files Browse the repository at this point in the history
Signed-off-by: bsbds <69835502+bsbds@users.noreply.github.com>
  • Loading branch information
bsbds committed Oct 8, 2024
1 parent d02eb54 commit abb2556
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/xline/tests/it/maintenance_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,16 @@ async fn test_status() -> Result<(), Box<dyn std::error::Error>> {
let mut cluster = Cluster::new_rocks(3).await;
cluster.start().await;
let client = cluster.client().await;
// adds some data to the db
let _ignore = client.kv_client().put("foo", "bar", None).await?;
// ensure that the key is persistent
let _ignore = client.kv_client().put("foo", "bar1", None).await?;
let mut maintenance_client = client.maintenance_client();
let res = maintenance_client.status().await?;
assert_eq!(res.version, env!("CARGO_PKG_VERSION"));
assert!(res.db_size > 0);
assert!(res.db_size_in_use > 0);
assert_ne!(res.leader, 0);
assert_eq!(res.leader, 0);
assert!(res.raft_index >= res.raft_applied_index);
assert_eq!(res.raft_term, 1);
assert!(res.raft_applied_index > 0);
Expand Down

0 comments on commit abb2556

Please sign in to comment.