Skip to content

Fix absence of pytest kill in Cancel Test Run#25932

Open
kornevgen wants to merge 2 commits into
microsoft:mainfrom
kornevgen:fix-cancel-test-run
Open

Fix absence of pytest kill in Cancel Test Run#25932
kornevgen wants to merge 2 commits into
microsoft:mainfrom
kornevgen:fix-cancel-test-run

Conversation

@kornevgen

Copy link
Copy Markdown

Fixes #21507

Commit 354fcd6 has removed initialisation of resultProc variable. So cancelling can't kill pytest because resultProc is undefined. PR restores that initialisation.

Tested by click on 'Cancel Test Run'. Reaction on cancelling has appeared immediately.

Label: bug

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restores initialization of the pytest subprocess handle in the pytest execution adapter so that “Cancel Test Run” can actually terminate an in-progress pytest run (regression described in #21507).

Changes:

  • Reintroduces assigning the spawned pytest child process (result?.proc) to a local variable used by the cancellation handler.
Show a summary per file
File Description
src/client/testing/testController/pytest/pytestExecutionAdapter.ts Restores tracking of the pytest child process so cancellation can attempt to kill it.

Review details

  • Files reviewed: 1/1 changed files
  • Comments generated: 2
  • Review effort level: Low

Comment on lines 248 to 250
const result = execService?.execObservable(runArgs, spawnOptions);
resultProc = result?.proc;

Comment on lines 248 to 250
const result = execService?.execObservable(runArgs, spawnOptions);
resultProc = result?.proc;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cancel test run doesn't seem to work

2 participants