Skip to content

test(cluster): unskip test_cluster_slots_malformed (stale skip after #425 fix) - #442

Merged
fcostaoliveira merged 1 commit into
masterfrom
test/unskip-cluster-slots-malformed
Jun 2, 2026
Merged

fcostaoliveira merged 1 commit into
masterfrom
test/unskip-cluster-slots-malformed

Conversation

@fcostaoliveira

@fcostaoliveira fcostaoliveira commented Jun 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • test_cluster_slots_malformed in tests/test_resp_response_fuzzer.py was env.skip()'d with a TODO(#417) note because the underlying handle_cluster_slots crash hadn't been fixed yet.
  • PR fix(cluster-slots): validate reply shape before indexing, log+skip malformed shards #425 merged the fix (full shape-validation in cluster_client::handle_cluster_slots): null top-level array, empty topology, per-shard mbulk type checks, slot-bound range/order validation, zero-length and NUL-embedded host/port guards, and every-shard-malformed fallback.
  • This PR removes the stale skip and wires up the test correctly: memtier is launched with --cluster-mode (so the bootstrap CLUSTER SLOTS call occurs) and the mock server is started without --passthrough-cluster (so the adversarial fixture bytes are served as the CLUSTER reply). A cluster_mode parameter is threaded through _run_fixture / _assert_no_crash to support this.

Test plan

  • Run OSS_STANDALONE=1 TEST="test_resp_response_fuzzer.py:test_cluster_slots_malformed" ./tests/run_tests.sh — should report [PASS] in ~6 s.
  • Run the full test_resp_response_fuzzer.py suite to confirm no regressions in the other 11 fixtures.
  • Confirm no SIGSEGV / Segmentation fault / AddressSanitizer needle in memtier stderr.

🤖 Generated with Claude Code


Note

Low Risk
Test-harness changes only; no production code paths modified.

Overview
Re-enables test_cluster_slots_malformed after the handle_cluster_slots hardening in PR #425. The test had been env.skip() with a TODO for issue #417 (SIGSEGV on malformed CLUSTER SLOTS).

The harness now supports cluster_mode: _run_fixture / _assert_no_crash can launch memtier with --cluster-mode so bootstrap issues CLUSTER SLOTS and the mock serves cluster_slots_malformed.bin as that reply (without --passthrough-cluster). The cluster test calls _assert_no_crash(..., cluster_mode=True) instead of skipping.

Reviewed by Cursor Bugbot for commit 97cfc80. Bugbot is set up for automated code reviews on this repo. Configure here.

PR #425 added shape validation to handle_cluster_slots so a malformed
CLUSTER SLOTS reply no longer SIGSEGVs via OOB indexing. The
regression test was left env.skip()'d with a stale TODO(#417) note.
Verified the fixture exercises the validated path and memtier no
longer crashes; removing the skip restores CI coverage for the fix.

Also threads a cluster_mode parameter through _run_fixture and
_assert_no_crash so the test can launch memtier with --cluster-mode
(required for the bootstrap CLUSTER SLOTS call to occur) while the
mock server serves the adversarial fixture bytes as the CLUSTER reply.

Refs: 2.4 review #14/#22 (Review 1 + Review 8 + Review 29).

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@jit-ci

jit-ci Bot commented Jun 2, 2026

Copy link
Copy Markdown

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@fcostaoliveira
fcostaoliveira merged commit e7e889b into master Jun 2, 2026
82 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.

1 participant