test(batch): the batch-size-limit tests add unvectored items — they test batching, not embedding
Some checks failed
Delta Gate / Delta gate — candidate vs control (push) Waiting to run
CI / Node 22 (push) Successful in 12m25s
CI / Node 24 (push) Successful in 12m15s
CI / Integration + conformance (Node 22) (push) Failing after 17m13s
CI / Bun (latest) (push) Successful in 12m33s
Some checks failed
Delta Gate / Delta gate — candidate vs control (push) Waiting to run
CI / Node 22 (push) Successful in 12m25s
CI / Node 24 (push) Successful in 12m15s
CI / Integration + conformance (Node 22) (push) Failing after 17m13s
CI / Bun (latest) (push) Successful in 12m33s
This commit is contained in:
parent
dea3ec2031
commit
a1423c6da7
1 changed files with 22 additions and 9 deletions
|
|
@ -113,7 +113,12 @@ describe('Brainy Batch Operations', () => {
|
||||||
items: Array.from({ length: 100 }, (_, i) => ({
|
items: Array.from({ length: 100 }, (_, i) => ({
|
||||||
data: `Bulk ${i}`,
|
data: `Bulk ${i}`,
|
||||||
type: NounType.Thing,
|
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
|
const manyIds = manyResult.successful
|
||||||
|
|
@ -274,7 +279,12 @@ describe('Brainy Batch Operations', () => {
|
||||||
const manyResult = await brain.addMany({
|
const manyResult = await brain.addMany({
|
||||||
items: Array.from({ length: 100 }, (_, i) => ({
|
items: Array.from({ length: 100 }, (_, i) => ({
|
||||||
data: `Bulk Delete ${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
|
const manyIds = manyResult.successful
|
||||||
|
|
@ -545,10 +555,18 @@ describe('Brainy Batch Operations', () => {
|
||||||
|
|
||||||
it('should validate batch size limits', async () => {
|
it('should validate batch size limits', async () => {
|
||||||
// Try to add a large batch (reduced from 10000 to 1000 for reasonable test time)
|
// 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 largeCount = 1000
|
||||||
const largeItems = Array.from({ length: largeCount }, (_, i) => ({
|
const largeItems = Array.from({ length: largeCount }, (_, i) => ({
|
||||||
data: `Large ${i}`,
|
data: `Large ${i}`,
|
||||||
type: NounType.Thing
|
type: NounType.Thing,
|
||||||
|
vector: []
|
||||||
}))
|
}))
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
@ -560,12 +578,7 @@ describe('Brainy Batch Operations', () => {
|
||||||
// Might throw if there's a limit
|
// Might throw if there's a limit
|
||||||
expect(error).toBeDefined()
|
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 () => {
|
it('should provide meaningful error messages', async () => {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Reference in a new issue