Skip to content

Run the RESP3 miss-tracking tests instead of silently skipping them - #862

Merged
fcostaoliveira merged 2 commits into
masterfrom
claude/resp3-probe-tests
Oct 25, 2026
Merged

fcostaoliveira merged 2 commits into
masterfrom
claude/resp3-probe-tests

Conversation

@fcostaoliveira

@fcostaoliveira fcostaoliveira commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #861.

Problem

In every CI cell, on master and on PR heads, test_arbitrary_get_resp3_nil_counted_as_miss and test_arbitrary_get_resp3_literal_underscore_not_counted_as_miss are 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() sends HELLO 3 on env.getConnection(). RLTest creates that client with protocol=2, so redis-py (without the optional hiredis package, which CI does not install) uses its RESP2-only parser and raises InvalidResponse: Protocol Error: b'%7' on the RESP3 map reply. The probe's bare except Exception: return False then turns that error into a skip. tests/include.py::server_supports_resp3 already reads INFO server instead (#456), but this file kept its own copy of the old probe.

Change

  • The two GET tests: use the shared 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 without redis_version raises an AssertionError. test_read_preference_resp3.py is the other caller and gets the same behaviour.
  • New test_arbitrary_mget_resp3_nulls_and_literal_underscore: both existing tests use GET, which never reaches the ArrayPerElementNulls / bulk_el::is_resp3_null path. The new test runs a fixed MGET on 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.
  • Docstring fix: the literal-_ GET test's docstring no longer claims to cover is_resp3_null.

Validation

test_arbitrary_command_misses.py against standalone Redis 8.6.0:

Tests Skipped Failed
master, with and without REDIS_PASSWORD 16 2 0
this PR, with and without REDIS_PASSWORD 17 0 0

The tests pass once they run, so the skip was not hiding a memtier bug.

Mutation check, built from scratch copies:

Mutant GET nil GET literal _ MGET resp3
RESP3 _ no longer a miss in GET replies FAIL pass pass
is_resp3_null broken (_ elements count as hits) pass pass FAIL
a stored _ value treated as a null pass FAIL pass

Before this PR, the second mutant passed every test, even though MGET --protocol=resp3 misses 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=2 when that commit merged.

Related: #462, where a different helper silently skips the read-preference cell.

🤖 Generated with Claude Code

fcostaoliveira and others added 2 commits October 25, 2026 01:24
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]>
@fcostaoliveira

Copy link
Copy Markdown
Collaborator Author

Review summary for 0344516:

  • CI results: CI on the head shows the three RESP3 tests passing in all 15 standalone cells: plaintext, auth, TLS, TLS 1.2 and 1.3, and the ASAN/TSAN/UBSan standalone cells. In the 5 cluster cells they skip through skipOnCluster, which runs before the probe. On master 68f07ce, both GET tests skip in all 20 cells.
  • Other caller: test_read_preference_resp3.py results are identical to master in every cell. Locally it also gives the same results on base and head under OSS_CLUSTER_REPLICAS=1 SHARDS=3.
  • Mutation check: each of the three mutants from the description is killed by exactly one test. A fourth mutant, a 1-byte bulk inside an array counted as a miss, is killed by the new MGET test only.
  • Root cause: reproduced through env.getConnection() in standalone and 3-shard cluster setups, plaintext, with a password, and with TLS. Every one raised InvalidResponse: Protocol Error: b'%7' (RLTest protocol=2, no hiredis).

@fcostaoliveira
fcostaoliveira merged commit 39e0bb7 into master Oct 25, 2026
146 checks passed
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.

tests: RESP3 miss-tracking tests in test_arbitrary_command_misses.py are always skipped (HELLO 3 probe over RLTest's RESP2 connection)

1 participant