Skip to content

Commit f0e7f0a

Browse files
committed
build: dispose the llama instance before a test worker exists
1 parent 93a41a7 commit f0e7f0a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/utils/getTestLlama.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
1+
import {afterAll} from "vitest";
12
import {getLlama, Llama} from "../../src/index.js";
3+
import {isCI} from "../../src/config.js";
24

35
let llamaPromise: Promise<Llama> | null = null;
46

7+
afterAll(async () => {
8+
if (!isCI)
9+
return;
10+
11+
if (llamaPromise != null) {
12+
const temp = llamaPromise;
13+
llamaPromise = null;
14+
await (await temp).dispose();
15+
}
16+
});
17+
518
export async function getTestLlama() {
619
if (llamaPromise != null)
720
return await llamaPromise;

0 commit comments

Comments
 (0)