Repository navigation
Run the RESP3 miss-tracking tests instead of silently skipping them - #862
Merged
Merged
Conversation
The two RESP3 tests in test_arbitrary_command_misses.py were skipped on every server. Their local probe sent HELLO 3 over the RLTest connection, which RLTest creates with protocol=2. The server answers with a RESP3 map (%7), redis-py's RESP2 parser raises InvalidResponse, and the bare "except Exception: return False" turned that into a skip, so both tests never ran since they were added in #435. Use the shared server_supports_resp3() helper from include.py, which reads redis_version from INFO server and stays on RESP2. Also drop the helper's catch-all: a probe that cannot decide now fails the test, and only a server older than Redis 6 is skipped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The RESP3 GET tests take the SingleNullBulk path, so nothing covered the ArrayPerElementNulls walker: counting every '_' element of an MGET reply as a hit dropped its misses to zero without any test failing. Add an MGET test under --protocol=resp3 with literal key names, so every reply is [v1, "_" (stored value), null, null] and the hit/miss split is exact, including the stored '_' at key[1] counting as a hit. HMGET shares the same walker, so it needs no separate test. Correct the literal-'_' GET test's docstring, which claimed to guard bulk_el::is_resp3_null. Fixes #861 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
|
Review summary for 0344516:
|
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.
Fixes #861.
Problem
In every CI cell, on master and on PR heads,
test_arbitrary_get_resp3_nil_counted_as_missandtest_arbitrary_get_resp3_literal_underscore_not_counted_as_missare reported as SKIP. RLTest counts skips as passes, so the RESP3 nil-as-miss handling from #435 has never actually run in CI.The file's own
_server_supports_resp3()sendsHELLO 3onenv.getConnection(). RLTest creates that client withprotocol=2, so redis-py (without the optionalhiredispackage, which CI does not install) uses its RESP2-only parser and raisesInvalidResponse: Protocol Error: b'%7'on the RESP3 map reply. The probe's bareexcept Exception: return Falsethen turns that error into a skip.tests/include.py::server_supports_resp3already readsINFO serverinstead (#456), but this file kept its own copy of the old probe.Change
server_supports_resp3(), and the local probe is removed. Only a server older than Redis 6 skips.server_supports_resp3()no longer catches errors: a probe that cannot decide now fails the test instead of skipping it. A reply withoutredis_versionraises anAssertionError.test_read_preference_resp3.pyis the other caller and gets the same behaviour.test_arbitrary_mget_resp3_nulls_and_literal_underscore: both existing tests use GET, which never reaches the ArrayPerElementNulls /bulk_el::is_resp3_nullpath. The new test runs a fixedMGETon two existing keys (one with the value_) and two missing keys with--protocol=resp3. It asserts the exact split (800 hits, 800 misses over 400 calls) and the per-position hit/miss counts._GET test's docstring no longer claims to coveris_resp3_null.Validation
test_arbitrary_command_misses.pyagainst standalone Redis 8.6.0:REDIS_PASSWORDREDIS_PASSWORDThe tests pass once they run, so the skip was not hiding a memtier bug.
Mutation check, built from scratch copies:
__no longer a miss in GET repliesis_resp3_nullbroken (_elements count as hits)_value treated as a nullBefore this PR, the second mutant passed every test, even though
MGET --protocol=resp3misses dropped from 280 to 0.Affected versions
Test coverage only; memtier itself counts RESP3 nil correctly. The probe and both GET tests came with 2f5d953 (#435), which is in 2.4.0 through 2.5.2. The probe has never worked, because RLTest's test client had already defaulted to
protocol=2when that commit merged.Related: #462, where a different helper silently skips the read-preference cell.
🤖 Generated with Claude Code