11// Copyright (c) Microsoft Corporation. All rights reserved.
22// Licensed under the MIT License.
33
4- import { CancellationTokenSource , DebugSessionOptions , TestRun , TestRunProfileKind , Uri } from 'vscode' ;
4+ import { DebugSessionOptions , TestRun , TestRunProfileKind , Uri } from 'vscode' ;
55import * as path from 'path' ;
66import { ChildProcess } from 'child_process' ;
77import { IConfigurationService , ITestOutputChannel } from '../../../common/types' ;
@@ -174,7 +174,7 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter {
174174 await debugLauncher ! . launchDebugger (
175175 launchOptions ,
176176 ( ) => {
177- serverCancel . cancel ( ) ;
177+ serverDispose ( ) ; // this will resolve the deferredTillAllServerClose
178178 } ,
179179 sessionOptions ,
180180 ) ;
@@ -196,7 +196,7 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter {
196196 traceInfo ( `Test run cancelled, killing pytest subprocess for workspace ${ uri . fsPath } ` ) ;
197197 proc . kill ( ) ;
198198 deferredTillExecClose . resolve ( ) ;
199- serverCancel . cancel ( ) ;
199+ serverDispose ( ) ; // this will resolve the deferredTillAllServerClose
200200 } ) ;
201201 proc . stdout . on ( 'data' , ( data ) => {
202202 const out = utils . fixLogLinesNoTrailing ( data . toString ( ) ) ;
@@ -216,7 +216,7 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter {
216216 ) ;
217217 }
218218 deferredTillExecClose . resolve ( ) ;
219- serverCancel . cancel ( ) ;
219+ serverDispose ( ) ; // this will resolve the deferredTillAllServerClose
220220 } ) ;
221221 await deferredTillExecClose . promise ;
222222 } else {
0 commit comments