Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolve debug session when session is canceled #21360

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/client/testing/testController/common/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ export class PythonTestServer implements ITestServer, Disposable {
testProvider: UNITTEST_PROVIDER,
};
traceInfo(`Running DEBUG unittest with arguments: ${args}\r\n`);
await this.debugLauncher!.launchDebugger(launchOptions);
await this.debugLauncher!.launchDebugger(launchOptions).then(() => {
traceInfo('Debugging has finished.');
});
} else {
if (isRun) {
// This means it is running the test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter {
pytestRunTestIdsPort,
};
traceInfo(`Running DEBUG pytest with arguments: ${testArgs.join(' ')}\r\n`);
await debugLauncher!.launchDebugger(launchOptions);
await debugLauncher!.launchDebugger(launchOptions).then(() => {
traceInfo('Debugging has finished.');
});
} else {
// combine path to run script with run args
const scriptPath = path.join(fullPluginPath, 'vscode_pytest', 'run_pytest_script.py');
Expand All @@ -187,7 +189,7 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter {
traceError(`Error while running tests: ${testIds}\r\n${ex}\r\n\r\n`);
return Promise.reject(ex);
}

deferred.resolve();
return deferred.promise;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ export class UnittestTestExecutionAdapter implements ITestExecutionAdapter {

// Send test command to server.
// Server fire onDataReceived event once it gets response.
this.testServer.sendCommand(options);
await this.testServer.sendCommand(options);
deferred.resolve();

return deferred.promise;
}
Expand Down