Skip to content

Commit 60cab8d

Browse files
committed
Enhance error logging for virtual environment deletion in DeepnoteEnvironmentManager. Added detailed message output when deletion fails, improving debugging capabilities. Updated unit test comment for clarity.
Signed-off-by: Tomas Kislan <tomas@kislan.sk>
1 parent b79d0ef commit 60cab8d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/kernels/deepnote/environments/deepnoteEnvironmentManager.node.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ export class DeepnoteEnvironmentManager implements IExtensionSyncActivationServi
208208
} catch (error) {
209209
// Log but don't fail - the directory might not exist or might already be deleted
210210
logger.warn(`Failed to delete virtual environment directory: ${config.venvPath.fsPath}`, error);
211+
const msg = error instanceof Error ? error.message : String(error);
212+
this.outputChannel.appendLine(
213+
l10n.t('Failed to delete Deepnote virtual environment directory for "{0}": {1}', config.name, msg)
214+
);
211215
}
212216

213217
Cancellation.throwIfCanceled(token);

src/kernels/deepnote/environments/deepnoteEnvironmentManager.unit.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,7 @@ suite('DeepnoteEnvironmentManager', () => {
284284
// Delete the environment
285285
await manager.deleteEnvironment(config.id);
286286

287-
// Verify directory no longer exists (with a small delay to allow async operation)
288-
await new Promise((resolve) => setTimeout(resolve, 100));
287+
// Verify directory no longer exists
289288
assert.isFalse(fs.existsSync(venvDirPath), 'Directory should not exist after deletion');
290289
});
291290
});

0 commit comments

Comments
 (0)