diff --git a/src/client/proposedApi.ts b/src/client/proposedApi.ts index 1b710a888c99..f49d7338975d 100644 --- a/src/client/proposedApi.ts +++ b/src/client/proposedApi.ts @@ -149,6 +149,7 @@ export function buildProposedApi( } if (e.old) { if (e.new) { + traceVerbose('Python API env change detected', env.id, 'update'); onEnvironmentsChanged.fire({ type: 'update', env: convertEnvInfoAndGetReference(e.new) }); reportInterpretersChanged([ { @@ -157,6 +158,7 @@ export function buildProposedApi( }, ]); } else { + traceVerbose('Python API env change detected', env.id, 'remove'); onEnvironmentsChanged.fire({ type: 'remove', env: convertEnvInfoAndGetReference(e.old) }); reportInterpretersChanged([ { @@ -166,6 +168,7 @@ export function buildProposedApi( ]); } } else if (e.new) { + traceVerbose('Python API env change detected', env.id, 'add'); onEnvironmentsChanged.fire({ type: 'add', env: convertEnvInfoAndGetReference(e.new) }); reportInterpretersChanged([ { diff --git a/src/client/pythonEnvironments/base/info/interpreter.ts b/src/client/pythonEnvironments/base/info/interpreter.ts index f696bd40d173..5341a8f561ae 100644 --- a/src/client/pythonEnvironments/base/info/interpreter.ts +++ b/src/client/pythonEnvironments/base/info/interpreter.ts @@ -2,6 +2,7 @@ // Licensed under the MIT License. import { PythonExecutableInfo, PythonVersion } from '.'; +import { isCI } from '../../../common/constants'; import { interpreterInfo as getInterpreterInfoCommand, InterpreterInfoJson, @@ -80,13 +81,15 @@ export async function getInterpreterInfo( '', ); + // Sometimes on CI, the python process takes a long time to start up. This is a workaround for that. + const standardTimeout = isCI ? 30000 : 15000; // Try shell execing the command, followed by the arguments. This will make node kill the process if it // takes too long. // Sometimes the python path isn't valid, timeout if that's the case. // See these two bugs: // https://github.com/microsoft/vscode-python/issues/7569 // https://github.com/microsoft/vscode-python/issues/7760 - const result = await shellExecute(quoted, { timeout: timeout ?? 15000 }); + const result = await shellExecute(quoted, { timeout: timeout ?? standardTimeout }); if (result.stderr) { traceError( `Stderr when executing script with >> ${quoted} << stderr: ${result.stderr}, still attempting to parse output`, diff --git a/src/client/pythonEnvironments/base/locators/composite/envsCollectionCache.ts b/src/client/pythonEnvironments/base/locators/composite/envsCollectionCache.ts index b8ae5bcf4cd2..acf7626e6935 100644 --- a/src/client/pythonEnvironments/base/locators/composite/envsCollectionCache.ts +++ b/src/client/pythonEnvironments/base/locators/composite/envsCollectionCache.ts @@ -126,6 +126,7 @@ export class PythonEnvInfoCache extends PythonEnvsWatcher { const env = this.envs.splice(index, 1)[0]; + traceVerbose(`Removing invalid env from cache ${env.id}`); this.fire({ old: env, new: undefined }); }); if (envs) {