test: cover concurrent registry and close cleanup
This commit is contained in:
@@ -254,18 +254,21 @@ test("bootstraps a checkout and activates a validated immutable snapshot", async
|
||||
});
|
||||
});
|
||||
|
||||
test("first list lazily bootstraps a clean registry", async () => {
|
||||
test("concurrent first lists lazily bootstrap a clean registry once safely", async () => {
|
||||
const remote = await fixture();
|
||||
const root = join(remote.root, "registry");
|
||||
const registry = new WorkspaceRegistry(config(root, remote.remote));
|
||||
|
||||
await expect(registry.list()).resolves.toEqual([
|
||||
expect.objectContaining({
|
||||
id: "psd-clinical",
|
||||
commit: remote.initialCommit,
|
||||
state: "operational",
|
||||
}),
|
||||
]);
|
||||
const [first, second] = await Promise.all([registry.list(), registry.list()]);
|
||||
for (const revisions of [first, second]) {
|
||||
expect(revisions).toEqual([
|
||||
expect.objectContaining({
|
||||
id: "psd-clinical",
|
||||
commit: remote.initialCommit,
|
||||
state: "operational",
|
||||
}),
|
||||
]);
|
||||
}
|
||||
expect(existsSync(join(root, "state", "active.json"))).toBe(true);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user