MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / wt_diagnose_count

Function wt_diagnose_count

tests/test_watcher.c:324–338  ·  view source on GitHub ↗

Self-diagnosing count check: this suite's flake family blocked two * releases because a bare count assert cannot say WHY — print the * committed/pending dirty signatures on mismatch, so the next occurrence * names its cause (sigs equal = detection miss; different = reindex path). * Use at any index_call_count assertion site. */

Source from the content-addressed store, hash-verified

322 * names its cause (sigs equal = detection miss; different = reindex path).
323 * Use at any index_call_count assertion site. */
324static void wt_diagnose_count(cbm_watcher_t *w, const char *project, int got, int expected) {
325 if (got == expected) {
326 return;
327 }
328 uint64_t last = 0, pending = 0;
329 if (cbm_watcher_test_dirty_sigs(w, project, &last, &pending) == 0) {
330 printf(" watcher diagnose: count=%d expected=%d last_sig=%016llx pending_sig=%016llx "
331 "(%s)\n",
332 got, expected, (unsigned long long)last, (unsigned long long)pending,
333 last == pending ? "sigs EQUAL — the poll saw no new dirty state"
334 : "sigs differ — detection fired, reindex path suspect");
335 } else {
336 printf(" watcher diagnose: count=%d expected=%d (project not watched?)\n", got, expected);
337 }
338}
339
340/* Wait-for-the-asserted-state (bounded) for REACH assertions only: reaching
341 * a count is safe to wait for, because #937 guarantees an unchanged dirty

Callers 1

test_watcher.cFile · 0.85

Calls 1

Tested by

no test coverage detected