MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / alter_below_floor_rejected

Function alter_below_floor_rejected

nodedb/tests/bitemporal_array_alter.rs:112–161  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110/// unchanged.
111#[tokio::test]
112async fn alter_below_floor_rejected() {
113 let srv = TestServer::start().await;
114
115 srv.exec(
116 "CREATE ARRAY alter_floor \
117 DIMS (x INT64 [0..1000]) \
118 ATTRS (v INT64) \
119 TILE_EXTENTS (100) \
120 WITH (audit_retain_ms = 10000, minimum_audit_retain_ms = 5000)",
121 )
122 .await
123 .expect("CREATE ARRAY must succeed");
124
125 // Try to lower below the floor.
126 let result = srv
127 .exec("ALTER ARRAY alter_floor SET (audit_retain_ms = 1000)")
128 .await;
129 assert!(
130 result.is_err(),
131 "ALTER ARRAY below compliance floor must be rejected"
132 );
133
134 // Catalog must be unchanged.
135 let cat = srv.shared.array_catalog.read().unwrap();
136 let entry = cat
137 .lookup_by_name("alter_floor")
138 .expect("entry must still exist after rejected ALTER");
139 assert_eq!(
140 entry.audit_retain_ms,
141 Some(10000),
142 "catalog must be unchanged after rejected ALTER"
143 );
144 assert_eq!(
145 entry.minimum_audit_retain_ms,
146 Some(5000),
147 "floor must be unchanged after rejected ALTER"
148 );
149 drop(cat);
150
151 // Registry must still contain the original value.
152 let snap = srv.shared.bitemporal_retention_registry.snapshot();
153 let arr = snap
154 .iter()
155 .find(|e| e.collection == "alter_floor")
156 .expect("registry must still contain alter_floor after rejected ALTER");
157 assert_eq!(
158 arr.retention.audit_retain_ms, 10000,
159 "registry must be unchanged after rejected ALTER"
160 );
161}
162
163// ── test 3 ────────────────────────────────────────────────────────────────────
164

Callers

nothing calls this directly

Calls 7

lookup_by_nameMethod · 0.80
expectMethod · 0.45
execMethod · 0.45
readMethod · 0.45
snapshotMethod · 0.45
findMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected