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

Discovery cancellation #24713

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

eleanorjboyd
Copy link
Member

fixes #24602

@eleanorjboyd eleanorjboyd added the feature-request Request for new features or functionality label Jan 10, 2025
@eleanorjboyd eleanorjboyd self-assigned this Jan 10, 2025
@karthiknadig karthiknadig requested a review from Copilot January 10, 2025 20:58
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.

Files not reviewed (2)
  • src/client/testing/testController/workspaceTestAdapter.ts: Evaluated as low risk
  • src/client/testing/testController/pytest/pytestExecutionAdapter.ts: Evaluated as low risk
Comments suppressed due to low confidence (1)

src/client/testing/testController/pytest/pytestDiscoveryAdapter.ts:130

  • Redundant cancellation handling. The token?.onCancellationRequested callback is defined twice, once for proc and once for resultProc. This can be simplified to avoid confusion.
token?.onCancellationRequested(() => {

Tip: Leave feedback on Copilot's review comments with the 👎 and 👍 buttons to help improve review quality. Learn more

token?.onCancellationRequested(() => {
traceInfo(`Test discovery cancelled.`);
cSource.cancel();
deferredReturn.resolve({ cwd: uri.fsPath, status: 'success' });
Copy link
Preview

Copilot AI Jan 10, 2025

Choose a reason for hiding this comment

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

The status message should indicate that the operation was canceled, not 'success'. Consider using a status like 'canceled'.

Suggested change
deferredReturn.resolve({ cwd: uri.fsPath, status: 'success' });
deferredReturn.resolve({ cwd: uri.fsPath, status: 'canceled' });

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Copy link
Member Author

Choose a reason for hiding this comment

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

so the actual return value isn't really used at all in production code- currently it is just awaited on the workspaceTestAdapter. Should I just made it an empty promise and remove this whole "status" concept @karthiknadig

Copy link
Member

Choose a reason for hiding this comment

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

That might make it more readable. So, make it a empty promise, now that old code is all removed.

@eleanorjboyd eleanorjboyd marked this pull request as ready for review January 10, 2025 22:55
Copy link

This PR originates from a fork. If the changes appear safe, you can trigger the pipeline by commenting /AzurePipelines run.

@vs-code-engineering vs-code-engineering bot added this to the January 2025 milestone Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make test discovery cancellable
2 participants