From 793217550345920da576031a0e5118a2e360ffdf Mon Sep 17 00:00:00 2001 From: David Snelling Date: Wed, 2 Sep 2026 13:43:08 -0700 Subject: [PATCH] test(vfs): reclassify the many-files wall-clock case into the perf lane MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit vfs.unit.test.ts's 'Performance > should handle many files efficiently' (100 writes + readdir, 5.5s write budget) is a wall-clock flake: 121ms alone, 16.5s under the gate's sibling-file contention — the code never caused it. Same pattern already used for storage-batch-operations.test.ts's batch-vs-individual timing case: ctx.skip(!process.env.BRAINY_PERF_LANE, reason) inside the test, and the file added to vitest.perf.config.ts's include list (it stays in the unit gate's *.unit.test.ts match too, so every other test in the file keeps running there). --- tests/configs/vitest.perf.config.ts | 9 ++++++++- tests/vfs/vfs.unit.test.ts | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/configs/vitest.perf.config.ts b/tests/configs/vitest.perf.config.ts index 6c0f2d1b..6936a71c 100644 --- a/tests/configs/vitest.perf.config.ts +++ b/tests/configs/vitest.perf.config.ts @@ -57,7 +57,14 @@ export default defineConfig({ // 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' + 'tests/integration/storage-batch-operations.test.ts', + // Same pattern: one wall-clock budget case (100-file write + readdir, + // 5.5s budget) inside an otherwise-correctness VFS unit suite + // (self-skipped everywhere else via BRAINY_PERF_LANE — see + // tests/vfs/vfs.unit.test.ts's 'Performance > should handle many + // files efficiently'). Stays in the unit gate's *.unit.test.ts match + // too, so every OTHER test in the file keeps running there. + 'tests/vfs/vfs.unit.test.ts' ], reporters: process.env.CI ? ['dot'] : ['basic'], diff --git a/tests/vfs/vfs.unit.test.ts b/tests/vfs/vfs.unit.test.ts index 4b4ba8d2..b4024155 100644 --- a/tests/vfs/vfs.unit.test.ts +++ b/tests/vfs/vfs.unit.test.ts @@ -389,7 +389,14 @@ describe('VirtualFileSystem - Production Tests', () => { }) describe('Performance', () => { - it('should handle many files efficiently', async () => { + it('should handle many files efficiently', async (ctx) => { + // Wall-clock budget assertion — belongs to the perf lane (npm run + // test:perf), not the correctness gate: 121ms alone but 16.5s under + // the gate's sibling-file contention, a flake the code never caused + // (same pattern as storage-batch-operations.test.ts's batch-vs- + // individual timing case). + ctx.skip(!process.env.BRAINY_PERF_LANE, 'wall-clock budget assertion — runs only under the perf lane (npm run test:perf)') + const dir = '/performance-test' await vfs.mkdir(dir)