tests: a shared-instance client reads the rows of a running owner

This commit is contained in:
DeFiDude committed 2026-11-15 11:50:44 -07:00
1 parent acab1fa55d
commit a088135b0e
1 file changed
+18
@@ -2119,6 +2119,24 @@ mod tests {
let _ = std::fs::remove_dir_all(dir);
}
#[test]
fn a_shared_instance_client_reads_a_running_owners_rows() {
let dir = temp_dir();
let mut owner = actor_on(&dir);
owner
.recent_announces
.insert([5; 16], entry([5; 16], Some(1000.0), false));
owner.kd.pending.mark_dirty([5; 16]);
owner.flush_known_destinations();
settle(&mut owner);
// The owner keeps its database open, the rows still in its WAL.
let client = client_on(&dir);
assert!(client.recent_announces.contains_key(&[5; 16]));
drop(client);
owner.on_shutdown();
let _ = std::fs::remove_dir_all(dir);
}
#[test]
fn a_shared_instance_client_writes_nothing() {
let dir = temp_dir();