This is an automated email from the ASF dual-hosted git repository.
zyxxoo pushed a commit to branch refactor/rust-rewrite-design
in repository https://gitbox.apache.org/repos/asf/hugegraph.git
The following commit(s) were added to refs/heads/refactor/rust-rewrite-design
by this push:
new 00e6b05e8 test(poc): record cache oracle verification
00e6b05e8 is described below
commit 00e6b05e83b62825e6b3a474fa89a35ab43440c2
Author: vaughn <[email protected]>
AuthorDate: Thu Sep 10 02:19:44 2026 +0800
test(poc): record cache oracle verification
---
docs/rust-rewrite-partition-pilot.md | 2 ++
tools/rust-partition-poc/src/lib.rs | 18 +++++++++++++++---
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/docs/rust-rewrite-partition-pilot.md
b/docs/rust-rewrite-partition-pilot.md
index 60686c706..0ff91a2f1 100644
--- a/docs/rust-rewrite-partition-pilot.md
+++ b/docs/rust-rewrite-partition-pilot.md
@@ -57,3 +57,5 @@ A standalone invariant oracle was implemented at
`tools/rust-partition-poc`. It
重试记录:改用 `-Dmaven.repo.local=/tmp/hugegraph-m2` 后,构建因 DNS 无法解析
`repo.maven.apache.org`,缺少 `org.apache:apache:23` 父 POM而停止。该环境阻塞仍未计作测试通过。
Rust 工程门禁记录:`cargo fmt -- --check`、`cargo clippy --all-targets -- -D warnings`
和 `cargo test` 均通过;测试仍为 9 项通过。
+
+缓存 Oracle 补充:新增缓存版本等价与失效拒绝测试;`verify.sh` 运行结果为 **11 passed, 0
failed**。这仍是模型层证据,真实 watch 通知丢失场景待 PD 集成环境恢复后执行。
diff --git a/tools/rust-partition-poc/src/lib.rs
b/tools/rust-partition-poc/src/lib.rs
index e2f760914..5030dbe7b 100644
--- a/tools/rust-partition-poc/src/lib.rs
+++ b/tools/rust-partition-poc/src/lib.rs
@@ -215,15 +215,27 @@ mod cache_tests {
#[test]
fn invalidation_requires_latest_value() {
- let source = Partition { start: 0, end: 10, version: 2 };
- let cached = Partition { start: 0, end: 10, version: 1 };
+ let source = Partition {
+ start: 0,
+ end: 10,
+ version: 2,
+ };
+ let cached = Partition {
+ start: 0,
+ end: 10,
+ version: 1,
+ };
assert_eq!(cache_read(Some(cached), &source), Err("cache-stale"));
assert_eq!(cache_read(None, &source), Err("cache-stale"));
}
#[test]
fn latest_cache_value_is_equivalent_to_source() {
- let source = Partition { start: 0, end: 10, version: 2 };
+ let source = Partition {
+ start: 0,
+ end: 10,
+ version: 2,
+ };
assert_eq!(cache_read(Some(source.clone()), &source), Ok(source));
}
}