Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
Print the rows that did not commit when the lock-wait drain test is about to fail
garrytanc9465209cbcb
diff --git a/test/e2e/persistence-preparation-lock-wait-postgres.test.ts b/test/e2e/persistence-preparation-lock-wait-postgres.test.tsindex cee2b441c1..f2f0ffda37 100644--- a/test/e2e/persistence-preparation-lock-wait-postgres.test.ts+++ b/test/e2e/persistence-preparation-lock-wait-postgres.test.ts@@ -184,6 +184,11 @@ describe.skipIf(!hasDatabase())('a lock-blocked preparation read ends at the budexpect(observed.leftover ?? []).toEqual([]);expect(observed.clearedAfterMs).toBeLessThan(SLACK_MS);// The root was free: the same member and every page committed once the lock dropped, and the counter reset on commit.+ if (result.drain?.outcome !== 'synced') {+ const uncommitted = (await imports(engine, f.id)).filter(row => row.state !== 'committed')+ .map(({ slug, state, error_code, error_message }) => ({ slug, state, error_code, error_message }));+ console.error(`[lock-wait] drain ${JSON.stringify(result.drain)}; rows not committed: ${JSON.stringify(uncommitted)}`);+ }expect(result.drain).toMatchObject({ outcome: 'synced' });const rows = await imports(engine, f.id);expect(rows.find(row => row.slug === stuckSlug)).toMatchObject({ state: 'committed', preparation_attempts: 0 });