Skip to content

Test | Fix pool reflection in tests #3379

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

Merged
merged 1 commit into from
May 27, 2025

Conversation

mdaigle
Copy link
Contributor

@mdaigle mdaigle commented May 27, 2025

Description

My last PR ran as a forked build and so missed some tests that use reflection to access pool properties. This PR corrects the issue and runs as a branch build to ensure full coverage.

Issues

Fixes test failures due to #3352

Testing

Runs full test suite (including branch-build-only tests)

Guidelines

Please review the contribution guidelines before submitting a pull request:

@Copilot Copilot AI review requested due to automatic review settings May 27, 2025 18:04
@mdaigle mdaigle requested a review from a team as a code owner May 27, 2025 18:04
Copy link
Contributor

@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.

Pull Request Overview

This PR fixes issues with test failures by correcting the reflection usage to access pool properties in authentication tests.

  • Changed reflection binding flags for "AuthenticationContexts" from non-public to public.
  • Ensured that tests now correctly access the intended property using the updated API.
Comments suppressed due to low confidence (1)

src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/Common/SystemDataInternals/FedAuthTokenHelper.cs:99

  • The change from BindingFlags.NonPublic to BindingFlags.Public indicates an adjustment to access a now public member. Please confirm that this update aligns with the overall API design and that any related documentation has been updated accordingly.
IEnumerable authenticationContexts = (IEnumerable)databaseConnectionPoolObj.GetType().GetProperty("AuthenticationContexts", BindingFlags.Public | BindingFlags.Instance).GetValue(databaseConnectionPoolObj, null);

Copy link

codecov bot commented May 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.45%. Comparing base (b8948f2) to head (2fd3001).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3379      +/-   ##
==========================================
- Coverage   67.04%   64.45%   -2.59%     
==========================================
  Files         300      298       -2     
  Lines       65376    65525     +149     
==========================================
- Hits        43831    42236    -1595     
- Misses      21545    23289    +1744     
Flag Coverage Δ
addons 92.58% <ø> (ø)
netcore 68.48% <ø> (-3.72%) ⬇️
netfx 65.37% <ø> (+0.18%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@paulmedynski paulmedynski merged commit e980d0c into main May 27, 2025
251 checks passed
@paulmedynski paulmedynski deleted the dev/mdaigle/fix-pool-reflection branch May 27, 2025 23:13
@paulmedynski paulmedynski added this to the 6.1-preview2 milestone Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants