mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-30 15:03:57 +00:00
fix(test): make memory ingestion-status test residue-robust (queue_depth delta) (#2721)
This commit is contained in:
@@ -367,6 +367,12 @@ mod tests {
|
||||
let client = ensure_memory_client();
|
||||
let state = client.ingestion_state();
|
||||
|
||||
// `queue_depth` is an AtomicUsize on the process-global ingestion state,
|
||||
// which is shared (and not reset) across every memory::ops test. A prior
|
||||
// test's in-flight ingestion can leave residue, so assert the delta from a
|
||||
// captured baseline rather than an absolute depth — the snapshot fields set
|
||||
// by mark_running below are overwritten per-call and remain deterministic.
|
||||
let baseline_depth = state.snapshot().queue_depth;
|
||||
state.enqueue();
|
||||
state.mark_running("doc-sync", "Sync Title", "sync-test");
|
||||
|
||||
@@ -379,7 +385,7 @@ mod tests {
|
||||
assert_eq!(status.current_document_id.as_deref(), Some("doc-sync"));
|
||||
assert_eq!(status.current_title.as_deref(), Some("Sync Title"));
|
||||
assert_eq!(status.current_namespace.as_deref(), Some("sync-test"));
|
||||
assert_eq!(status.queue_depth, 1);
|
||||
assert_eq!(status.queue_depth, baseline_depth + 1);
|
||||
|
||||
state.dequeue();
|
||||
state.mark_completed("doc-sync", true, 12345);
|
||||
|
||||
Reference in New Issue
Block a user