Skip to content

Commit 8e00522

Browse files
committed
test: stub fs.access in fast-path get tests
The fast-path resolver now does a real fs.promises.access on the persisted path. The manager-level fast-path tests use synthetic paths that don't exist, causing tryFastPathGet to fall through to real initialization (and TypeError / 180s timeouts). Stub access to resolve so the fast path still fires.
1 parent c58ca22 commit 8e00522

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/test/managers/fastPath.get.unit.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT License.
33

44
import * as assert from 'assert';
5+
import * as fs from 'fs';
56
import * as path from 'path';
67
import * as sinon from 'sinon';
78
import { Uri } from 'vscode';
@@ -284,6 +285,9 @@ suite('Manager get() fast path', () => {
284285
setup(() => {
285286
sandbox = sinon.createSandbox();
286287
sandbox.stub(windowApis, 'withProgress').callsFake((_opts, cb) => cb(undefined as never, undefined as never));
288+
// fastPath.ts now does a real fs.access on the persisted path; these tests use
289+
// synthetic paths that don't exist on disk, so pretend every path is present.
290+
sandbox.stub(fs.promises, 'access').resolves();
287291
});
288292

289293
teardown(() => {

0 commit comments

Comments
 (0)