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

Function assert_noop

nodedb/src/control/catalog_entry/tests/invalidation.rs:142–161  ·  view source on GitHub ↗
(
    shared: &Arc<SharedState>,
    cache: &Arc<PlanCache>,
    entry: CatalogEntry,
    label: &str,
)

Source from the content-addressed store, hash-verified

140// require pages of boilerplate without adding behavioral coverage.
141
142fn assert_noop(
143 shared: &Arc<SharedState>,
144 cache: &Arc<PlanCache>,
145 entry: CatalogEntry,
146 label: &str,
147) {
148 // Plant a sentinel for "sentinel_col" and assert it survives.
149 let key = plant_sentinel(cache, "sentinel_col");
150 let size_before = cache.len();
151
152 invalidate_gateway_cache_for_entry(&entry, shared);
153
154 assert_eq!(cache.len(), size_before, "{label}: cache must not change");
155 assert!(
156 cache.get(&key).is_some(),
157 "{label}: sentinel entry must survive"
158 );
159 // Remove sentinel to keep cache clean for next assertion.
160 cache.invalidate_descriptor("sentinel_col", 0);
161}
162
163#[tokio::test]
164async fn no_op_variants_do_not_evict_plan_cache() {

Calls 4

plant_sentinelFunction · 0.85
invalidate_descriptorMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected