diff --git a/tests/configs/vitest.perf.config.ts b/tests/configs/vitest.perf.config.ts index ca665dae..6c0f2d1b 100644 --- a/tests/configs/vitest.perf.config.ts +++ b/tests/configs/vitest.perf.config.ts @@ -21,6 +21,13 @@ export default defineConfig({ setupFiles: ['./tests/setup.ts'], environment: 'node', + // The marker a test uses to tell it is running under this lane (see + // tests/integration/storage-batch-operations.test.ts's batch-vs- + // individual timing case) — a wall-clock RATIO assertion self-skips + // with a reason when this is absent, rather than flaking the + // correctness gate on whichever path happens to be faster this build. + env: { BRAINY_PERF_LANE: '1' }, + // Sequential, single fork — same isolation the gate uses, so a perf // measurement isn't skewed by sibling test contention. pool: 'forks', @@ -45,7 +52,12 @@ export default defineConfig({ 'tests/critical-performance-benchmark.test.ts', 'tests/api/performance-benchmarks.test.ts', 'tests/package-size-limit.test.ts', - 'tests/model-loading.test.ts' + 'tests/model-loading.test.ts', + // Not a whole perf file — one wall-clock-ratio case inside an + // otherwise-correctness integration suite (self-skipped everywhere + // else via BRAINY_PERF_LANE). Stays in the integration gate's + // include too, so every OTHER test in the file keeps running there. + 'tests/integration/storage-batch-operations.test.ts' ], reporters: process.env.CI ? ['dot'] : ['basic'], diff --git a/tests/integration/storage-batch-operations.test.ts b/tests/integration/storage-batch-operations.test.ts index 9972df1a..53547fe5 100644 --- a/tests/integration/storage-batch-operations.test.ts +++ b/tests/integration/storage-batch-operations.test.ts @@ -95,7 +95,13 @@ describe('Storage-Level Batch Operations v5.12.0', () => { expect(entity?.vector?.length).toBeGreaterThan(0) }) - it('should be faster than individual gets for large batches', async () => { + it('should be faster than individual gets for large batches', async (ctx) => { + // Wall-clock RATIO assertion — belongs to the perf lane (npm run + // test:perf), not the correctness gate: under the exclusive release + // gate this flaked when individual gets got faster on their own + // (open-path/hydration changes), not because batchGet regressed. + ctx.skip(!process.env.BRAINY_PERF_LANE, 'timing-ratio assertion — runs only under the perf lane (npm run test:perf)') + // Create 100 entities const ids: string[] = [] for (let i = 0; i < 100; i++) {