openvibers/openrestream Commits

Reset coordinator test rows with DELETE since the pg test role can't…

OP OpenVibers committed 13 Oct 2026 · a43f19dfb9 · 1 file, +4 −2

Requested by finish-f1. Handed to the local harness by the cloud job pr-OpenRestream-66; done by Claude opus.

Changes

ddiff --git a/test/coordinator.test.js b/test/coordinator.test.js
iindex a66df4c..bdf919c 100644
---- a/test/coordinator.test.js
++++ b/test/coordinator.test.js
@@@ -8,12 +8,14 @@ const { createWorkerRuntime } = require('../workers/runtime');
const t = suite('coordinator');
const dir = tmpDir();
++const RESET = ['output_logs', 'outputs', 'recordings', 'ingest_sessions', 'stream_definitions', 'workers', 'event_outbox', 'leases'];
async function setup() {
const clock = manualClock();
const rt = await runtime({ clock, dir });
-- // Every case starts with fresh rows, while helpers.testDb reuses the migrated database.
-- await rt.db.prepare('TRUNCATE TABLE stream_definitions, workers, event_outbox, leases, output_logs RESTART IDENTITY CASCADE').run();
++ // Every case starts with fresh rows, while helpers.testDb reuses the migrated database. DELETE, child
++ // tables first: the pg store's runtime role has DML only, not TRUNCATE.
++ for (const table of RESET) await rt.db.prepare(`DELETE FROM ${table}`).run();
const coordinator = createCoordinator({ rt, media: null, log: silent });
const { definition, key } = await rt.store.definitions.create({ owner_subject: OWNER });
const worker = async (kind) => { const w = await rt.store.workers.register({ kind, endpoints: { flvPort: 19361, rtmpPlayPort: 19360 } }); await rt.store.workers.ready(w.id); return await rt.store.workers.get(w.id); };