test(redis): add live e2e guards for StackExchange.Redis internal reflection - #82
Merged
Merged
Conversation
…lection Two reflection sites reach into StackExchange.Redis private internals and fail silently, so unit tests (which mock the Redis interfaces) cannot detect them degrading — a risk ahead of the upcoming 2.1x and 3.0 upgrades. - Add ProfiledCommandExtensionsIntegrationTests: runs a keyed command against live Redis and asserts GetStatement() carries the key, which only holds when the ProfiledCommand.Message -> Message.CommandAndKey reflection resolves. - Strengthen the existing GetMasterPhysicalConnectionMetrics test to also check the reflected endpoint and a sane AwaitingResponseCount, catching a wrong-but-present field bind, not just a null. Both gated by RUN_REDIS_INTEGRATION_TESTS=1. Verified against live Redis on net8.0 and net10.0 at the current 2.10.1 baseline. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Cosmin Staicu <cosmin.staicu@uipath.com>
cosmin-staicu
requested review from
alinahornet,
cosminvlad,
litheon,
lucianaparaschivei and
razvalex
as code owners
July 16, 2026 15:31
|
razvalex
approved these changes
Jul 16, 2026
5 tasks
cosmin-staicu
added a commit
that referenced
this pull request
Jul 16, 2026
First step of the staged StackExchange.Redis upgrade toward 3.0. 2.13.17 is the latest 2.x and shares 3.0's public API, so it de-risks the major bump. No public API or runtime behavior change. The only breakage was a test fixture: SE.Redis 2.13.17 grew the internal StreamInfo constructor from 7 to 16 parameters, and RedisStreamHealthMaintainerTests fabricates StreamInfo via reflection with a hardcoded positional arg list. The old 7-arg call no longer bound, the fixture threw, and the maintainer's try/catch swallowed it — surfacing as "received no matching calls" on the downstream mocks. Production is unaffected (it gets real StreamInfo objects from SE.Redis deserialization, never this reflection). GenerateStreamInfo now fills by the ctor's actual parameter list and sets only the fields the maintainer reads, so it survives this bump and the upcoming 3.0 one. Verified: full suite green on net8.0 and net10.0 (1174/1174 each), including the live-Redis reflection guards from #82. Signed-off-by: Cosmin Staicu <cosmin.staicu@uipath.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
5 tasks
cosmin-staicu
added a commit
that referenced
this pull request
Jul 17, 2026
Final step of the staged StackExchange.Redis upgrade. 3.0 is an internal IO-core rewrite that mirrors 2.13.17's public API, so there is no public API change. Stacked on the Logging.Abstractions bump (that package is a hard transitive prerequisite for 3.0). 3.0 removed SocketManager (its new IO core no longer uses one), so ConfigurationOptions.SocketManager is obsolete. Dropped the now-dead assignment in RedisConfigurationOptionsProvider and marked the backing option RedisConnectionOptions.ThreadPoolSocketManager [Obsolete] (no-op, non-breaking signature) so consumers get a signal rather than a silent no-op. The two silent-failing reflection paths were the upgrade's main risk. Verified against live Redis on both TFMs via the guards added in #82: hang-detection metrics (GetMasterPhysicalConnectionMetrics) still resolve real values, and the profiling GetStatement still carries the command key. Benchmarks' admin FLUSHALL is unaffected (the runner already sets allowAdmin=true). The Azure Entra/RESP3 path is covered by build + configurator unit tests only (no live Azure endpoint); its runtime behavior is unverified in this PR. Full suite green on net8.0 and net10.0 (1174/1174 each) with RUN_REDIS_INTEGRATION_TESTS=1. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Cosmin Staicu <cosmin.staicu@uipath.com>
cosmin-staicu
added a commit
that referenced
this pull request
Jul 17, 2026
Final step of the staged StackExchange.Redis upgrade. 3.0 is an internal IO-core rewrite that mirrors 2.13.17's public API, so there is no public API change. Stacked on the Logging.Abstractions bump (that package is a hard transitive prerequisite for 3.0). 3.0 removed SocketManager (its new IO core no longer uses one), so ConfigurationOptions.SocketManager is obsolete. Dropped the now-dead assignment in RedisConfigurationOptionsProvider and marked the backing option RedisConnectionOptions.ThreadPoolSocketManager [Obsolete] (no-op, non-breaking signature) so consumers get a signal rather than a silent no-op. The two silent-failing reflection paths were the upgrade's main risk. Verified against live Redis on both TFMs via the guards added in #82: hang-detection metrics (GetMasterPhysicalConnectionMetrics) still resolve real values, and the profiling GetStatement still carries the command key. Benchmarks' admin FLUSHALL is unaffected (the runner already sets allowAdmin=true). The Azure Entra/RESP3 path is covered by build + configurator unit tests only (no live Azure endpoint); its runtime behavior is unverified in this PR. Full suite green on net8.0 and net10.0 (1174/1174 each) with RUN_REDIS_INTEGRATION_TESTS=1. Signed-off-by: Cosmin Staicu <cosmin.staicu@uipath.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
cosmin-staicu
added a commit
that referenced
this pull request
Jul 17, 2026
Final step of the staged StackExchange.Redis upgrade. 3.0 is an internal IO-core rewrite that mirrors 2.13.17's public API, so there is no public API change. Stacked on the Logging.Abstractions bump (that package is a hard transitive prerequisite for 3.0). 3.0 removed SocketManager (its new IO core no longer uses one), so ConfigurationOptions.SocketManager is obsolete. Dropped the now-dead assignment in RedisConfigurationOptionsProvider and marked the backing option RedisConnectionOptions.ThreadPoolSocketManager [Obsolete] (no-op, non-breaking signature) so consumers get a signal rather than a silent no-op. The two silent-failing reflection paths were the upgrade's main risk. Verified against live Redis on both TFMs via the guards added in #82: hang-detection metrics (GetMasterPhysicalConnectionMetrics) still resolve real values, and the profiling GetStatement still carries the command key. Benchmarks' admin FLUSHALL is unaffected (the runner already sets allowAdmin=true). The Azure Entra/RESP3 path is covered by build + configurator unit tests only (no live Azure endpoint); its runtime behavior is unverified in this PR. Full suite green on net8.0 and net10.0 (1174/1174 each) with RUN_REDIS_INTEGRATION_TESTS=1. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Cosmin Staicu <cosmin.staicu@uipath.com>
5 tasks
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.



Summary
Adds live end-to-end tests that guard the two places where the library reflects into StackExchange.Redis private internals. Both fail silently, so unit tests (which mock the Redis interfaces) can't detect them degrading — this lands the guards before the upcoming StackExchange.Redis
2.1xand3.0upgrades so those bumps have a real runtime tripwire.Changes
ProfiledCommandExtensionsIntegrationTests— runs a keyed command against live Redis and assertsGetStatement()carries the key. That only holds when theProfiledCommand.Message→Message.CommandAndKeyreflection resolves; on a silent miss it falls back to the bare command name and the test fails.GetMasterPhysicalConnectionMetricstest — was a bareNotBeNull; now also asserts the reflected endpoint and a saneAwaitingResponseCount, so a wrong-but-present field bind returning garbage is caught, not just a null.Both are gated behind
RUN_REDIS_INTEGRATION_TESTS=1(no change to the default test run).Context:
3.0is an internal IO-core rewrite touching exactly thePhysicalConnection/PhysicalBridgeinternals the hang-detection reflection reads. All 7 reflected members still exist at tag3.0.17, but only a live test proves the runtime values still resolve.Test plan
dotnet test)Verified against a live Redis on net8.0 and net10.0 at the current
2.10.1baseline (all 9 integration tests pass). Also mutation-proved the profiling guard: forcing the reflection to miss drops the key fromGetStatement()and the test fails as intended.Linked issues
Fixes #
Contributor declaration
git commit -s).🤖 Generated with Claude Code