FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Register test commands before first await to prevent activation race condition by Copilot · Pull Request #25654 · microsoft/vscode-python · GitHub

Register test commands before first await to prevent activation race condition - #25654

Merged
Eleanor Boyd (eleanorjboyd) merged 6 commits into
mainfrom
copilot/fix-configure-test-command
Dec 18, 2025
Merged

Register test commands before first await to prevent activation race condition#25654
Eleanor Boyd (eleanorjboyd) merged 6 commits into
mainfrom
copilot/fix-configure-test-command

Conversation

Copilot AI commented Dec 12, 2025
edited by eleanorjboyd
Loading

Copy link
Copy Markdown

fixes #22783 and #21865

The python.configureTests command was registered after multiple async operations during extension activation, creating a race condition where users could invoke the command before it was registered.

Changes

  • Extract command registration: Created standalone registerTestCommands() function in testing/main.ts containing all test command handlers (Tests_Configure, Tests_CopilotSetup, CopyTestId)

  • Register synchronously before first await: Moved unitTestsRegisterTypes() and registerTestCommands() to extension.ts immediately after initializeStandard(), before experimentService.activate()

  • Remove duplicate registrations: Cleaned up original registration in UnitTestManagementService.activate() and activateLegacy()

Copilot AI and others added 2 commits December 12, 2025 18:04
- Extract command registration logic from UnitTestManagementService into standalone registerTestCommands function
- Call registerTestCommands synchronously in activateLegacy before async operations
- This ensures commands are available immediately when extension activates, preventing "command not found" errors

Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
…vation

- Register test services (unitTestsRegisterTypes) before any async operations in extension.ts
- Register test commands immediately after service registration, before experimentService.activate()
- Remove duplicate registrations from extensionActivation.ts activateLegacy()
- This ensures commands are available synchronously when extension activates

Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue with test command not registering on extension activation Register test commands before first await to prevent activation race condition Dec 12, 2025
Eleanor Boyd (eleanorjboyd) marked this pull request as ready for review December 12, 2025 21:44
Eleanor Boyd (eleanorjboyd) added debt Code quality issues skip tests Updates to tests unnecessary labels Dec 12, 2025
vs-code-engineering Bot added this to the December / January 2026 milestone Dec 12, 2025
Eleanor Boyd (eleanorjboyd) merged commit dc7f9bf into main Dec 18, 2025
86 checks passed
Eleanor Boyd (eleanorjboyd) deleted the copilot/fix-configure-test-command branch December 18, 2025 18:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

debt Code quality issues skip tests Updates to tests unnecessary

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: Configure Tests command not found

4 participants


Back | FazBrowse Home | New Git URL