Optimize test result processing in PythonResultResolver to improve performance and reduce complexity#25471
Conversation
…rformance and reduce complexity
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the _resolveExecution method in PythonResultResolver to eliminate performance bottlenecks that were causing stack overflow issues with parameterized tests. The optimization replaces O(nmk) complexity tree rebuilding with efficient O(1) map-based lookups for test result processing.
Key changes:
- Replaces expensive tree traversal with cached lookup methods using existing maps
- Extracts outcome-specific handling into separate methods for better maintainability
- Adds comprehensive performance test to validate the optimization
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/client/testing/testController/common/resultResolver.ts |
Refactors _resolveExecution method to use efficient lookups and extracts outcome handlers into separate methods |
src/test/testing/common/testingAdapter.test.ts |
Adds performance test to validate efficient test result processing without tree rebuilding |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
If the changes appear safe, you can manually trigger the pipeline by commenting |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
If the changes appear safe, you can manually trigger the pipeline by commenting |
fixes #25366