From cb918387795a5f68bad4e7b8ea68633dd28d17ab Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Wed, 29 Dec 2021 15:32:25 -0800 Subject: [PATCH] Dispose kernels in test --- .../vscode-api-tests/src/singlefolder-tests/notebook.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/notebook.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/notebook.test.ts index 70165fb39ee..b5e72d11cc5 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/notebook.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/notebook.test.ts @@ -884,12 +884,12 @@ suite('Notebook API tests', function () { } override async _execute(cells: vscode.NotebookCell[]) { - console.log(`execute`); const [cell] = cells; const exe = this.controller.createNotebookCellExecution(cell); exe.token.onCancellationRequested(() => executionWasCancelled = true); } }; + testDisposables.push(cancelledKernel.controller); const notebook = await openRandomNotebookDocument(); await vscode.window.showNotebookDocument(notebook); @@ -913,7 +913,6 @@ suite('Notebook API tests', function () { } override async _execute(cells: vscode.NotebookCell[]) { - console.log(`execute`); const [cell] = cells; const exe = this.controller.createNotebookCellExecution(cell); exe.token.onCancellationRequested(() => executionWasCancelled = true); @@ -922,10 +921,12 @@ suite('Notebook API tests', function () { const notebook = await openRandomNotebookDocument(); await vscode.window.showNotebookDocument(notebook); + testDisposables.push(cancelledKernel.controller); await assertKernel(cancelledKernel, notebook); await vscode.commands.executeCommand('notebook.cell.execute'); const newKernel = new Kernel('newKernel', 'kernel'); + testDisposables.push(newKernel.controller); await assertKernel(newKernel, notebook); assert.strictEqual(executionWasCancelled, true); });