feat: add AI catalog description generation
This commit is contained in:
@@ -18,3 +18,23 @@ test("reserves duplicate database ids only once for a batch operation", async ()
|
||||
expect(await coordinator.runMany(["database-a", "database-a"], async () => "completed"))
|
||||
.toBe("completed");
|
||||
});
|
||||
|
||||
test("stale generation recovery releases only its own reservation token", () => {
|
||||
const coordinator = new CatalogOperationCoordinator();
|
||||
const releaseOtherOperation = coordinator.reserve("database-a");
|
||||
|
||||
coordinator.releaseStale("database-a", "description_generation");
|
||||
expect(() => coordinator.reserve("database-a")).toThrow(
|
||||
"A database operation is already in progress",
|
||||
);
|
||||
releaseOtherOperation();
|
||||
|
||||
const releaseStaleGeneration = coordinator.reserve("database-a", "description_generation");
|
||||
coordinator.releaseStale("database-a", "description_generation");
|
||||
const releaseNewOperation = coordinator.reserve("database-a");
|
||||
releaseStaleGeneration();
|
||||
expect(() => coordinator.reserve("database-a")).toThrow(
|
||||
"A database operation is already in progress",
|
||||
);
|
||||
releaseNewOperation();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user