diff --git a/tests/unit/brainy/batch-operations.test.ts b/tests/unit/brainy/batch-operations.test.ts index 889127ee..16f0f93d 100644 --- a/tests/unit/brainy/batch-operations.test.ts +++ b/tests/unit/brainy/batch-operations.test.ts @@ -113,7 +113,12 @@ describe('Brainy Batch Operations', () => { items: Array.from({ length: 100 }, (_, i) => ({ data: `Bulk ${i}`, type: NounType.Thing, - metadata: { counter: 0 } + metadata: { counter: 0 }, + // This test exercises updateMany's batching, not embedding — the + // sanctioned "unvectored" `[]` shape (see + // tests/integration/index-skips-unvectored.test.ts) skips the + // real embedder entirely. + vector: [] })) }) const manyIds = manyResult.successful @@ -274,7 +279,12 @@ describe('Brainy Batch Operations', () => { const manyResult = await brain.addMany({ items: Array.from({ length: 100 }, (_, i) => ({ data: `Bulk Delete ${i}`, - type: NounType.Thing + type: NounType.Thing, + // This test exercises removeMany's batching, not embedding — the + // sanctioned "unvectored" `[]` shape (see + // tests/integration/index-skips-unvectored.test.ts) skips the + // real embedder entirely. + vector: [] })) }) const manyIds = manyResult.successful @@ -545,10 +555,18 @@ describe('Brainy Batch Operations', () => { it('should validate batch size limits', async () => { // Try to add a large batch (reduced from 10000 to 1000 for reasonable test time) + // This test validates the batch SIZE law, not embeddings — items carry + // the sanctioned "unvectored" `[]` shape (see + // tests/integration/index-skips-unvectored.test.ts) so addMany's batch + // embedder is never invoked; 1000 real embeddings under the root + // vitest config (which does not mock the embedder) is a 60-180s + // budget flake waiting to happen, not a defect in what this test + // actually asserts. const largeCount = 1000 const largeItems = Array.from({ length: largeCount }, (_, i) => ({ data: `Large ${i}`, - type: NounType.Thing + type: NounType.Thing, + vector: [] })) try { @@ -560,12 +578,7 @@ describe('Brainy Batch Operations', () => { // Might throw if there's a limit expect(error).toBeDefined() } - // order-of-magnitude guard: this test batches 20x the item count of the - // sibling "perform better" test above (worst measured 11.9s for 50 - // items on CPU-only honest iron); the prior 60s timeout was itself - // observed being hit, so this is 3x that floor rather than a scaled - // extrapolation, to leave real headroom for run-to-run variance - }, 180000) + }) it('should provide meaningful error messages', async () => { try {