Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

test: release the paused catalog transaction when setup fails (#12500)

[._.]/ Adam Eivy74c0489ff63a
diff --git a/server/services/catalogSync.changeClock.db.test.js b/server/services/catalogSync.changeClock.db.test.js
index 7f7b62015f..a60529e1d3 100644
--- a/server/services/catalogSync.changeClock.db.test.js
+++ b/server/services/catalogSync.changeClock.db.test.js
@@ -76,9 +76,18 @@ describe.skipIf(!runDb)('catalog conflict clock is monotonic at wire precision (
});
await started;
- const versionB = await updateIngredient(ing.id, { name: 'Renamed By B' });
- const replica = replicaOf(versionB);
- expect(await replica.apply(versionB)).toMatchObject({ applied: true });
+ let versionB;
+ let replica;
+ try {
+ versionB = await updateIngredient(ing.id, { name: 'Renamed By B' });
+ replica = replicaOf(versionB);
+ expect(await replica.apply(versionB)).toMatchObject({ applied: true });
+ } catch (err) {
+ // Never leave A holding an open transaction and a pooled client.
+ resumeA();
+ await transactionA.catch(() => {});
+ throw err;
+ }
resumeA();
const versionA = await transactionA;