Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test(e2e): source rows inserted with a temp root are deleted before teardown

garrytan4ee6b9bdcf5a
diff --git a/test/e2e/cycle-maintenance-lock.test.ts b/test/e2e/cycle-maintenance-lock.test.ts
index 0891741087..1b460c6b4a 100644
--- a/test/e2e/cycle-maintenance-lock.test.ts
+++ b/test/e2e/cycle-maintenance-lock.test.ts
@@ -34,6 +34,8 @@ describeE2E('E2E: shared maintenance lease for source cycles (#6242)', () => {
}, 60_000);
afterAll(async () => {
+ // The source row would outlive its temp root and fail a later `gbrain init` in this shard (local_conflict).
+ await getConn().unsafe(`DELETE FROM sources WHERE id = 'beta'`);
await teardownDB();
rmSync(brainDir, { recursive: true, force: true });
rmSync(otherDir, { recursive: true, force: true });
diff --git a/test/e2e/doctor-silent-death-parity.test.ts b/test/e2e/doctor-silent-death-parity.test.ts
index 0e655ad3e2..fd0676e84c 100644
--- a/test/e2e/doctor-silent-death-parity.test.ts
+++ b/test/e2e/doctor-silent-death-parity.test.ts
@@ -24,7 +24,7 @@ import {
checkUndeclaredDbOnlyPages,
checkDbOnlyCollectorCollision,
} from '../../src/commands/doctor.ts';
-import { hasDatabase, setupDB, teardownDB, getEngine } from './helpers.ts';
+import { hasDatabase, setupDB, teardownDB, getEngine, getConn } from './helpers.ts';
import { operations } from '../../src/core/operations.ts';
import { disposePersistenceConsumer } from '../../src/core/persistence/service.ts';
import { withEnv } from '../helpers/with-env.ts';
@@ -212,6 +212,7 @@ describePg('engine parity: identical seeds, identical check results (PGLite vs P
afterAll(async () => {
if (pglite) await pglite.disconnect();
+ await getConn().unsafe(`DELETE FROM sources WHERE id = 'parity-src'`);
await teardownDB();
}, 60_000);
diff --git a/test/e2e/sync-parallel.test.ts b/test/e2e/sync-parallel.test.ts
index c3f414f681..5462bd07bb 100644
--- a/test/e2e/sync-parallel.test.ts
+++ b/test/e2e/sync-parallel.test.ts
@@ -175,6 +175,7 @@ describeE2E('E2E sync-parallel: T18 --timeout returns partial; last_commit uncha
afterAll(async () => {
if (repoPath) rmSync(repoPath, { recursive: true, force: true });
+ await getConn().unsafe(`DELETE FROM sources WHERE id IN ('e2e-timeout-source', 'e2e-timeout-partial')`);
await teardownDB();
});
diff --git a/test/e2e/sync-run-workers-postgres.test.ts b/test/e2e/sync-run-workers-postgres.test.ts
index 151b1ca6cf..2ba22152ce 100644
--- a/test/e2e/sync-run-workers-postgres.test.ts
+++ b/test/e2e/sync-run-workers-postgres.test.ts
@@ -38,6 +38,7 @@ describeE2E('E2E SyncRun: parallel worker completion under abort (W4 sync)', ()
afterAll(async () => {
if (repoPath) rmSync(repoPath, { recursive: true, force: true });
delete process.env.GBRAIN_SYNC_CHECKPOINT_EVERY;
+ await getConn().unsafe('DELETE FROM sources WHERE id = $1', [SOURCE]);
await teardownDB();
});