Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
test(persistence): read diagnostics wait for root transaction records to settle after an early-return read
garrytan51299c8a2cdc
diff --git a/test/persistence-read-diagnostics.test.ts b/test/persistence-read-diagnostics.test.tsindex 2e0b9fd045..ccb70365a6 100644--- a/test/persistence-read-diagnostics.test.ts+++ b/test/persistence-read-diagnostics.test.ts@@ -145,6 +145,8 @@ describe('bounded read diagnostics', () => {await diagnostics.read(0, 0, async () => {await Promise.all([engine.searchKeyword('fixture'), engine.searchTitles('fixture')]);});+ // A search read hands back its rows before its COMMIT settles (GBRA-156), so the root transaction records settle after the read.+ for (const deadline = Date.now() + 10_000; diagnostics.transactions.idle.records.some(r => r.outcome === 'pending') && Date.now() < deadline;) await Bun.sleep(5);expect(diagnostics.transactions.idle.total).toBe(2);expect(diagnostics.transactions.idle.records.every(r => r.query_index === 0 && r.outcome === 'fulfilled' && r.callback_ms !== null)).toBe(true);await engine.transaction(async tx => {