Skip to content

Commit 25f5af3

Browse files
authored
More logging for kernelspec problems (#10132)
* More logging for kernelspec problems * Actually capture the exception on the new code * Not actually using output if first exception still there. * Actually only return output on one of the expected calls. * Fix nightly flake
1 parent 6c0f326 commit 25f5af3

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/client/datascience/jupyter/interpreter/jupyterCommand.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ export class InterpreterJupyterKernelSpecCommand extends InterpreterJupyterComma
224224

225225
const defaultAction = () => {
226226
if (exception) {
227+
traceError(`Exception attempting to enumerate kernelspecs: `, exception);
227228
throw exception;
228229
}
229230
return output;
@@ -243,10 +244,12 @@ export class InterpreterJupyterKernelSpecCommand extends InterpreterJupyterComma
243244
try {
244245
if (args.join(' ').toLowerCase() === 'list --json') {
245246
// Try getting kernels using python script, if that fails (even if there's output in stderr) rethrow original exception.
246-
return this.getKernelSpecList(interpreter, options);
247+
output = await this.getKernelSpecList(interpreter, options);
248+
return output;
247249
} else if (args.join(' ').toLowerCase() === '--version') {
248250
// Try getting kernelspec version using python script, if that fails (even if there's output in stderr) rethrow original exception.
249-
return this.getKernelSpecVersion(interpreter, options);
251+
output = await this.getKernelSpecVersion(interpreter, options);
252+
return output;
250253
}
251254
} catch (innerEx) {
252255
traceError('Failed to get a list of the kernelspec using python script', innerEx);

src/client/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { CancellationToken } from 'vscode';
88
import { IApplicationShell } from '../../../common/application/types';
99
import { Cancellation, createPromiseFromCancellation, wrapCancellationTokens } from '../../../common/cancellation';
1010
import { ProductNames } from '../../../common/installer/productNames';
11+
import { traceError } from '../../../common/logger';
1112
import { IInstaller, InstallerResponse, Product } from '../../../common/types';
1213
import { Common, DataScience } from '../../../common/utils/localize';
1314
import { noop } from '../../../common/utils/misc';
@@ -302,7 +303,8 @@ export class JupyterInterpreterDependencyService {
302303
return command
303304
.exec(['--version'], { throwOnStdErr: true })
304305
.then(() => true)
305-
.catch(() => {
306+
.catch(e => {
307+
traceError(`Kernel spec not found: `, e);
306308
sendTelemetryEvent(Telemetry.KernelSpecNotFound);
307309
return false;
308310
});

src/test/datascience/variableexplorer.functional.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ myDict = {'a': 1}`;
301301
{
302302
name: 'mySet',
303303
value: undefined,
304-
supportsDataExplorer: true,
304+
supportsDataExplorer: false,
305305
type: 'set',
306306
size: 54,
307307
shape: '',

0 commit comments

Comments
 (0)