qmd/src/test-preload.ts
Tobi Lutke 537d15a9e6
fix: proper cleanup of Metal GPU resources in tests
Add test-preload.ts with global afterAll hook that ensures llama.cpp
Metal resources are properly disposed before process exit, avoiding
GGML_ASSERT failures.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 14:20:09 -04:00

14 lines
414 B
TypeScript

/**
* Test preload file to ensure proper cleanup of native resources.
*
* Uses bun:test afterAll to properly dispose of llama.cpp Metal
* resources before the process exits, avoiding GGML_ASSERT failures.
*/
import { afterAll } from "bun:test";
import { disposeDefaultLlamaCpp } from "./llm";
// Global afterAll runs after all test files complete
afterAll(async () => {
await disposeDefaultLlamaCpp();
});