Repository navigation
Stop the discovery manager factory from shadowing discoveryCriteria - #16391
Merged
Jakub Jareš (nohwnd) merged 2 commits intoAug 25, 2026
Merged
Jakub Jareš (nohwnd) merged 2 commits into
Jakub Jareš (nohwnd) merged 2 commits into
Conversation
The factory lambda in TestEngine.GetDiscoveryManager named its parameter discoveryCriteria, the same as the method parameter, but the two hold different data. The method receives the full criteria; the lambda receives the per-workload piece that ParallelProxyDiscoveryManager.SplitToWorkloads produces, normally a single source. Rename the lambda parameter to workloadCriteria and say in a comment which one arrives there. GetExecutionManager in the same file already names its lambda parameter runCriteria and documents the split. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR clarifies TestEngine.GetDiscoveryManager’s workload-creation lambda by avoiding parameter shadowing of discoveryCriteria, aligning it with the existing pattern used in GetExecutionManager. The goal is to make it explicit that the lambda receives the per-workload DiscoveryCriteria produced by ParallelProxyDiscoveryManager.SplitToWorkloads, without changing behavior.
Changes:
- Renamed the discovery-manager factory lambda parameter from
discoveryCriteriatoworkloadCriteria. - Updated the lambda to read sources from
workloadCriteria(the per-workload criteria), eliminating shadowing confusion. - Added an explanatory comment describing the split criteria flow.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The comment read `is not the discoveryCriteria this method received`, which scans as if the object of `received` went missing. Spell out the comparison. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This was referenced Nov 12, 2026
ptr727-codegen Bot
pushed a commit
to ptr727/Utilities
that referenced
this pull request
Nov 12, 2026
Updated [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 18.11.1 to 18.12.0. <details> <summary>Release notes</summary> _Sourced from [Microsoft.NET.Test.Sdk's releases](https://github.com/microsoft/vstest/releases)._ ## 18.12.0 ## Security fix This release includes the fix for CVE-2026-105544, an elevation of privilege vulnerability in the VSTest artifact post-processor. The post-processor could consume a forged `executionComplete.json` written by another local user, and then run attacker-controlled output handling. Affected: `Microsoft.TestPlatform.CLI` 18.11.0 and earlier. Every version from 18.11.1 on is fixed, including 18.12.0. `Microsoft.TestPlatform.CLI` is the VSTest build that we ship into the .NET SDK. The recommended way to get this fix is to update your .NET SDK to the latest patched version, see the advisory for the SDK versions. The fix is also released in the `Microsoft.TestPlatform.CLI` package, for completeness. That package is rarely used directly. It is not a dependency of `Microsoft.NET.Test.Sdk` or `Microsoft.TestPlatform`, so those packages do not bring it in. Details: https://github.com/microsoft/vstest/issues/16654 and https://github.com/dotnet/announcements/issues/517 Using custom Docker images or Nano Server? See https://github.com/microsoft/vstest/issues/16652 ## What's Changed * Fix TestCaseStart/Stop events dropped for data-driven tests with shared TestCase.Id by @nohwnd in https://github.com/microsoft/vstest/pull/16033 * Stop the discovery manager factory from shadowing discoveryCriteria by @nohwnd in https://github.com/microsoft/vstest/pull/16391 * Gate the HTTP link checker on a fingerprint of the broken links by @nohwnd in https://github.com/microsoft/vstest/pull/16413 * Quote boolean conditions in shipped Microsoft.TestPlatform.targets by @nohwnd in https://github.com/microsoft/vstest/pull/16404 * Obsolete API hygiene: the compatibility-safe changes by @azat-msft in https://github.com/microsoft/vstest/pull/16420 * Add xxHash128 test ids, available but not default by @azat-msft in https://github.com/microsoft/vstest/pull/16378 * Isolate attachment manager test temporary files by @mmitche in https://github.com/microsoft/vstest/pull/16463 * Test ids report logger by @azat-msft in https://github.com/microsoft/vstest/pull/16443 * Isolate code coverage files in published output by @azat-msft in https://github.com/microsoft/vstest/pull/16483 * Preserve OutputType for Android test projects by @jonathanpeppers in https://github.com/microsoft/vstest/pull/16496 * Fix dotnet host resolution under proot (ARM64/Termux) by @azat-msft in https://github.com/microsoft/vstest/pull/16462 * Mark the xxHash128 test id API as experimental by @azat-msft in https://github.com/microsoft/vstest/pull/16465 * Ship Microsoft.Diagnostics.NETCore.Client in Microsoft.TestPlatform and Portable packages by @nohwnd in https://github.com/microsoft/vstest/pull/16633 * Fix localized resource paths in CLI source-build/non-Windows packages by @nohwnd in https://github.com/microsoft/vstest/pull/16644 **Full Changelog**: https://github.com/microsoft/vstest/compare/v18.11.0...v18.12.0 Commits viewable in [compare view](https://github.com/microsoft/vstest/compare/v18.11.1...v18.12.0). </details> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This was referenced Dec 3, 2026
Open
Open
Open
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The factory lambda in
TestEngine.GetDiscoveryManagernamed its parameterdiscoveryCriteria, the same name as the method parameter, but the two hold different data. The method receives the full criteria with every source. The lambda receives the per-workload piece thatParallelProxyDiscoveryManager.SplitToWorkloadsproduces, normally a single source. Rename the lambda parameter toworkloadCriteriaand add a comment saying which of the two arrives there.GetExecutionManagerin the same file already does this — its lambda parameter isrunCriteriaand a comment explains the split.No behaviour change. The lambda still reads sources from the criteria it is handed.
Related: #16386. The repeated enumeration that issue reports does not exist —
Sourcesis read once in the method and once per workload inside the lambda, on two different objects. The fix it proposes, hoisting the outerSourcesinto a shared local, would pass every source toGetTestHostManagerByRunConfigurationfor every parallel slot instead of that slot's own source. The shadowing is what made that look correct, and this change removes it. It does not fix the issue, because there is nothing there to fix.Verified:
build.cmd -c Releasecompiles clean,Microsoft.TestPlatform.CrossPlatEngine.UnitTestspasses on net11.0 and net481.🤖