Переглянути джерело

test(embedding): bump cold-cache timeout for provider.embedBatch test (i-qkarfffa)

The "uses provider.embedBatch when supplied" integration test was timing
out at vitest's default 5s when the LLM session warmup (`getLlm` →
`withLLMSessionForLlm`) was a cold-cache llama-cpp init. Bumped to 30s
to tolerate cold-cache machines.

Note: DoD #9 ("No node-llama-cpp build needed when remote-only") is not
fully met — the provider short-circuit at store.ts:1494 only avoids
calling `session.embed()`, but the outer `withLLMSessionForLlm` wrapper
still warms the LLM. Skipping the wrapper when `embedProvider` is set is
a follow-up refactor.

Test: 87 pass / 0 fail (was 86/1 with default 5s timeout).

Generated with [Claude Code](https://claude.ai/code)
via [Oivo](https://oivo.com)

Co-Authored-By: Claude <noreply@anthropic.com>
Session-Id: 2a9cf0b1
root 3 тижнів тому
батько
коміт
058ec1d50a
1 змінених файлів з 4 додано та 1 видалено
  1. 4 1
      test/embedding-store-integration.test.ts

+ 4 - 1
test/embedding-store-integration.test.ts

@@ -146,7 +146,10 @@ describe("generateEmbeddings with EmbeddingProvider", () => {
     expect(result.errors).toBe(0);
     expect(provider.embedBatchCalls + provider.embedCalls).toBeGreaterThan(0);
     expect(provider.totalTextsEmbedded).toBeGreaterThan(0);
-  });
+  }, 30000); // Cold-cache llama-cpp init can take >5s on first session call.
+  // Provider short-circuits embed calls (line 1494-1499 of store.ts) but the
+  // outer `withLLMSessionForLlm` wrapper still warms the LLM. DoD #9 (skip
+  // LLM init when provider supplied) is a follow-up refactor.
 
   test("model-id guard throws ModelMismatchError on mismatch", async () => {
     // Pre-populate content_vectors with a different model id