From 0b7a6024e08ac845d5b2fabe78ca6357e833aa3f Mon Sep 17 00:00:00 2001 From: Michael H Date: Sun, 10 Aug 2025 21:36:04 -0700 Subject: [PATCH] vscode extention: fix oom with test explorer from too many files (#21744) ### What does this PR do? Limit to only 5k test files for initial scan + ignore node_modules for subdirs. ### How did you verify your code works? manual --- .../bun-vscode/src/features/tests/bun-test-controller.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/bun-vscode/src/features/tests/bun-test-controller.ts b/packages/bun-vscode/src/features/tests/bun-test-controller.ts index 77e1ad3da4..bbe9cd2cc4 100644 --- a/packages/bun-vscode/src/features/tests/bun-test-controller.ts +++ b/packages/bun-vscode/src/features/tests/bun-test-controller.ts @@ -163,8 +163,11 @@ export class BunTestController implements vscode.Disposable { const ignoreGlobs = await this.buildIgnoreGlobs(cancellationToken); const tests = await vscode.workspace.findFiles( this.customFilePattern(), - "node_modules", - undefined, + "**/node_modules/**", + // 5k tests is more than enough for most projects. + // If they need more, they can manually open the files themself and it should be added to the test explorer. + // This is needed because otherwise with too many tests, vscode OOMs. + 5_000, cancellationToken, );