Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: extend time tolerance for meta-service test #14927

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions src/meta/kvapi/src/kvapi/test_suite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,14 +416,18 @@ impl kvapi::TestSuite {
info!("--- get returns the value with meta and seq updated");
let key_value = kv.get_kv(test_key).await?;
assert!(key_value.is_some());
assert_eq!(
SeqV::with_meta(
seq + 1,
Some(KVMeta::new_expire(now_sec + 20)),
b"v1".to_vec()
),
key_value.unwrap(),
);

{
let res = key_value.unwrap();

assert_eq!(res.seq, seq + 1);
assert_eq!(res.data, b("v1"));

let meta = res.meta.unwrap();
let expire_at_sec = meta.get_expire_at_ms().unwrap() / 1000;
let want = now_sec + 20;
assert!((want..want + 2).contains(&expire_at_sec));
}

Ok(())
}
Expand Down
Loading