Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
Revert "fix(unit): comment out this test for now to see if the rest pass"
perf3ctdaa32e435588
diff --git a/apps/server/src/services/llm/providers/integration/streaming.spec.ts b/apps/server/src/services/llm/providers/integration/streaming.spec.tsindex a53805fbc9..068f725bd3 100644--- a/apps/server/src/services/llm/providers/integration/streaming.spec.ts+++ b/apps/server/src/services/llm/providers/integration/streaming.spec.ts@@ -70,7 +70,7 @@ describe('Provider Streaming Integration Tests', () => {expect(result.completeText).toBe('Hello world!');expect(result.chunkCount).toBe(4);expect(receivedChunks.length).toBeGreaterThan(0);-+// Verify callback received content chunksconst contentChunks = receivedChunks.filter(c => c.text);expect(contentChunks.length).toBe(3);@@ -167,7 +167,7 @@ describe('Provider Streaming Integration Tests', () => {expect(result.completeText).toBe('The weather today is sunny.');expect(result.chunkCount).toBe(4);-+// Verify final chunk has usage statsexpect(result.finalChunk.prompt_eval_count).toBe(15);expect(result.finalChunk.eval_count).toBe(8);@@ -312,7 +312,7 @@ describe('Provider Streaming Integration Tests', () => {);expect(result.completeText).toBe('Based on my analysis, the answer is 42.');-+// Verify thinking states were capturedconst thinkingChunks = receivedChunks.filter(c => c.chunk?.thinking);expect(thinkingChunks.length).toBe(2);@@ -325,7 +325,7 @@ describe('Provider Streaming Integration Tests', () => {async *[Symbol.asyncIterator]() {yield { message: { content: 'Starting...' } };// Simulate timeout- await new Promise((_, reject) =>+ await new Promise((_, reject) =>setTimeout(() => reject(new Error('Request timeout')), 100));}@@ -471,7 +471,7 @@ describe('Provider Streaming Integration Tests', () => {});});-/* describe('Memory Management', () => {+ describe('Memory Management', () => {it('should not leak memory during long streaming sessions', async () => {// Reduced chunk count for CI stability - still tests memory managementconst chunkCount = 1000; // Reduced from 10000@@ -482,7 +482,7 @@ describe('Provider Streaming Integration Tests', () => {message: { content: `Chunk ${i} with some additional content to increase memory usage` },done: i === (chunkCount - 1)};-+// Periodic yield to event loop to prevent blockingif (i % 50 === 0) { // More frequent yields for shorter testawait new Promise(resolve => setImmediate(resolve));@@ -492,16 +492,16 @@ describe('Provider Streaming Integration Tests', () => {};const initialMemory = process.memoryUsage();-+const result = await processProviderStream(longSessionIterator,mockProviderOptions);const finalMemory = process.memoryUsage();-+expect(result.chunkCount).toBe(chunkCount);-+// Memory increase should be reasonable (less than 20MB for smaller test)const memoryIncrease = finalMemory.heapUsed - initialMemory.heapUsed;expect(memoryIncrease).toBeLessThan(20 * 1024 * 1024);@@ -534,7 +534,7 @@ describe('Provider Streaming Integration Tests', () => {expect(resourceTracker.resources.size).toBe(0);});- }); */+ });describe('Provider-Specific Configurations', () => {it('should handle provider-specific options', async () => {