Skip to content

Commit a598753

Browse files
authored
Don't debug further tests when stopping the debug session (#1797)
* Don't debug further tests when stopping the debug session * Add changelog entry
1 parent f7fbd29 commit a598753

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
- Prompt to cancel and replace the active test run if one is in flight ([#1774](https://github.com/swiftlang/vscode-swift/pull/1774))
99
- A walkthrough for first time extension users ([#1560](https://github.com/swiftlang/vscode-swift/issues/1560))
1010

11+
### Fixed
12+
13+
- Don't start debugging XCTest cases if the swift-testing debug session was stopped ([#1797](https://github.com/swiftlang/vscode-swift/pull/1797))
14+
1115
## 2.11.20250806 - 2025-08-06
1216

1317
### Added

src/TestExplorer/TestRunner.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,10 @@ export class TestRunner {
700700
compositeToken.token
701701
);
702702

703+
// If the user terminates a debugging session for swift-testing
704+
// we want to prevent XCTest from starting.
705+
const terminationListener = runner.onDebugSessionTerminated(() => compositeToken.cancel());
706+
703707
// Register the test run with the manager
704708
folderContext.registerTestRun(runner.testRun, compositeToken);
705709

@@ -709,6 +713,8 @@ export class TestRunner {
709713
// Run the tests
710714
await runner.runHandler();
711715

716+
terminationListener.dispose();
717+
712718
// Run the post-run handler if provided
713719
if (postRunHandler) {
714720
await postRunHandler(runner);

0 commit comments

Comments
 (0)