cultcache-rs: tests that built two types at one redb key now build them directly or use distinct keys
All checks were successful
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Successful in 40m19s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-27 19:26:00 +01:00
commit 02cc731227

View file

@ -5610,9 +5610,16 @@ mod tests {
let (mut stamped, _) = cache.prepare_entry("shared", &note_one())?; let (mut stamped, _) = cache.prepare_entry("shared", &note_one())?;
stamped.schema_id = Some(Settings::TYPE.to_string()); stamped.schema_id = Some(Settings::TYPE.to_string());
{ {
let mut store = RedbMessagePackBackingStore::new(&path)?; // Written under the store's own guard this pair is refused, so the foreign state is put in the table directly.
store.push(&settings)?; let database = redb::Database::create(&path)?;
store.push(&stamped)?; let write = database.begin_write()?;
{
let mut table = write.open_table(REDB_ENVELOPES)?;
for row in [&settings, &stamped] {
table.insert(redb_identity(row)?.as_slice(), rmp_serde::to_vec(row)?.as_slice())?;
}
}
write.commit()?;
} }
cache.add_generic_backing_store(RedbMessagePackBackingStore::new(&path)?)?; cache.add_generic_backing_store(RedbMessagePackBackingStore::new(&path)?)?;
let error = cache.pull_all_backing_stores().unwrap_err(); let error = cache.pull_all_backing_stores().unwrap_err();
@ -6203,7 +6210,7 @@ mod tests {
let temp = tempfile::tempdir()?; let temp = tempfile::tempdir()?;
let path = temp.path().join("keyed.cc"); let path = temp.path().join("keyed.cc");
let model = test_envelope("model", "shared", b"one"); let model = test_envelope("model", "shared", b"one");
let receipt = test_envelope("receipt", "shared", b"two"); let receipt = test_envelope("receipt", "other", b"two");
{ {
let mut store = RedbMessagePackBackingStore::new(&path)?; let mut store = RedbMessagePackBackingStore::new(&path)?;
store.push(&model)?; store.push(&model)?;
@ -6388,7 +6395,7 @@ mod tests {
OwnedRedbMessagePackBackingStore::new(temp.path().join("compact-owned.cc"))?; OwnedRedbMessagePackBackingStore::new(temp.path().join("compact-owned.cc"))?;
let old_head = test_envelope("retention", "current", b"one"); let old_head = test_envelope("retention", "current", b"one");
let retired_a = test_envelope("claim", "a", b"terminal"); let retired_a = test_envelope("claim", "a", b"terminal");
let retired_b = test_envelope("receipt", "a", b"terminal"); let retired_b = test_envelope("receipt", "b", b"terminal");
owner.push(&old_head)?; owner.push(&old_head)?;
owner.push(&retired_a)?; owner.push(&retired_a)?;
owner.push(&retired_b)?; owner.push(&retired_b)?;