Fix KeyError in crossgen2_comparison.py for omitted_from_diff_dir lookups#126175
Fix KeyError in crossgen2_comparison.py for omitted_from_diff_dir lookups#126175
Conversation
… omitted_from_diff_dir lookups The omitted_from_diff_dir set contains assemblies present in the base directory but not in the diff directory. Line 922 was incorrectly looking up these assemblies in diff_results_by_name (where they don't exist) instead of base_results_by_name (where they do exist), causing an intermittent KeyError when an assembly was omitted from the diff output. Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/416242cd-0d0e-4de1-bc09-46f242809cd5 Co-authored-by: jtschuster <36744439+jtschuster@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes an intermittent KeyError in the crossgen2 comparison outerloop script when generating XML results for assemblies that are present in the base output but missing from the diff output.
Changes:
- Correct dictionary lookup for
omitted_from_diff_direntries by usingbase_results_by_nameinstead ofdiff_results_by_name.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
🤖 Copilot Code Review — PR #126175Note This review was generated by GitHub Copilot. Holistic AssessmentMotivation: The PR fixes a clear Approach: The fix is minimal and correct — switching the lookup to Summary: ✅ LGTM. This is a straightforward, correct bug fix with no risk of collateral damage. Detailed Findings✅ Correctness — Dictionary lookup fix is correctThe core fix changes
I verified the analogous ✅ Consistency —
|
Description
Crossgen2-comparison outerloop tests intermittently fail with
KeyError(e.g.KeyError: 'System.DirectoryServices') when an assembly is present in the base output but missing from the diff output.Root cause: When generating XML results for assemblies in
omitted_from_diff_dir(assemblies in base but not in diff), line 922 looked them up indiff_results_by_name— the dictionary that by definition does not contain them:The adjacent
omitted_from_base_dirloop correctly usesdiff_results_by_name; this was a copy-paste error in the opposite direction.📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.