Skip to content

Commit e1d105d

Browse files
author
Kartik Raj
committed
fix tests
1 parent fcd547e commit e1d105d

File tree

1 file changed

+16
-5
lines changed
  • src/client/pythonEnvironments/common/environmentManagers

1 file changed

+16
-5
lines changed

src/client/pythonEnvironments/common/environmentManagers/conda.ts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,15 @@ export class Conda {
271271
readonly command: string,
272272
shellCommand?: string,
273273
private readonly shellPath?: string,
274-
private readonly useWorkerThreads = inExperiment(DiscoveryUsingWorkers.experiment),
274+
private readonly useWorkerThreads?: boolean,
275275
) {
276+
if (this.useWorkerThreads === undefined) {
277+
try {
278+
this.useWorkerThreads = inExperiment(DiscoveryUsingWorkers.experiment);
279+
} catch {
280+
this.useWorkerThreads = false; // Temporarily support for legacy tests
281+
}
282+
}
276283
this.shellCommand = shellCommand ?? command;
277284
onDidChangePythonSetting(CONDAPATH_SETTING_KEY, () => {
278285
Conda.condaPromise = new Map<string | undefined, Promise<Conda | undefined>>();
@@ -292,10 +299,14 @@ export class Conda {
292299
*
293300
* @return A Conda instance corresponding to the binary, if successful; otherwise, undefined.
294301
*/
295-
private static async locate(
296-
shellPath?: string,
297-
useWorkerThreads = inExperiment(DiscoveryUsingWorkers.experiment),
298-
): Promise<Conda | undefined> {
302+
private static async locate(shellPath?: string, useWorkerThreads?: boolean): Promise<Conda | undefined> {
303+
if (useWorkerThreads === undefined) {
304+
try {
305+
useWorkerThreads = inExperiment(DiscoveryUsingWorkers.experiment);
306+
} catch {
307+
useWorkerThreads = false; // Temporarily support for legacy tests
308+
}
309+
}
299310
traceVerbose(`Searching for conda.`);
300311
const home = getUserHomeDir();
301312
let customCondaPath: string | undefined = 'conda';

0 commit comments

Comments
 (0)