Repository: redis/redis-py
File: tests/test_cluster.py (Python)

Code before:
            r.debug_segfault()

    def test_config_resetstat(self, r):
        node = r.get_primaries()[0]
        r.ping(target_nodes=node)
        prior_commands_processed = int(
            r.info(target_nodes=node)["total_commands_processed"]
        )
        assert prior_commands_processed >= 1
        r.config_resetstat(target_nodes=node)
        reset_commands_processed = int(
            r.info(target_nodes=node)["total_commands_processed"]
        )
        assert reset_commands_processed < prior_commands_processed

    @skip_if_server_version_lt("6.2.0")
    def test_client_trackinginfo(self, r):
        node = r.get_primaries()[0]
        res = r.client_trackinginfo(target_nodes=node)
        assert len(res) > 2
        assert "prefixes" in res or b"prefixes" in res

    @skip_if_server_version_lt("6.0.0")
    @skip_if_redis_enterprise()
    def test_client_tracking(self, r):
        # simple case - will execute on all node
        assert r.client_tracking_on()
        assert r.client_tracking_off()

        # id based
        node = r.get_default_node()
        # when id is provided - the command should be sent to the node that
        # owns the connection with this id
        client_id = node.redis_connection.client_id()
        assert r.client_tracking_on(clientid=client_id, target_nodes=node)
        assert r.client_tracking_off(clientid=client_id, target_nodes=node)

        # execute with client id and prefixes and bcast
        assert r.client_tracking_on(
            clientid=client_id, prefix=["foo", "bar"], bcast=True, target_nodes=node
        )

        # now with some prefixes and without bcast
        with pytest.raises(DataError):
            assert r.client_tracking_on(prefix=["foo", "bar", "blee"])

    @skip_if_server_version_lt("2.9.50")
    def test_client_pause(self, r):
        node = r.get_primaries()[0]
        assert r.client_pause(1, target_nodes=node)
        assert r.client_pause(timeout=1, target_nodes=node)

Review comment (suggestion):
Typo in comment: "all node" should be "all nodes"
```suggestion
        # simple case - will execute on all nodes
```

Code after:
            r.debug_segfault()

    def test_config_resetstat(self, r):
        node = r.get_primaries()[0]
        r.ping(target_nodes=node)
        prior_commands_processed = int(
            r.info(target_nodes=node)["total_commands_processed"]
        )
        assert prior_commands_processed >= 1
        r.config_resetstat(target_nodes=node)
        reset_commands_processed = int(
            r.info(target_nodes=node)["total_commands_processed"]
        )
        assert reset_commands_processed < prior_commands_processed

    @skip_if_server_version_lt("6.2.0")
    def test_client_trackinginfo(self, r):
        node = r.get_primaries()[0]
        res = r.client_trackinginfo(target_nodes=node)
        assert len(res) > 2
        assert "prefixes" in res or b"prefixes" in res

    @skip_if_server_version_lt("6.0.0")
    @skip_if_redis_enterprise()
    def test_client_tracking(self, r):
        # simple case - will execute on all nodes
        assert r.client_tracking_on()
        assert r.client_tracking_off()

        # id based
        node = r.get_default_node()
        # when id is provided - the command should be sent to the node that
        # owns the connection with this id
        client_id = node.redis_connection.client_id()
        assert r.client_tracking_on(clientid=client_id, target_nodes=node)
        assert r.client_tracking_off(clientid=client_id, target_nodes=node)

        # execute with client id and prefixes and bcast
        assert r.client_tracking_on(
            clientid=client_id, prefix=["foo", "bar"], bcast=True, target_nodes=node
        )

        # now with some prefixes and without bcast
        with pytest.raises(DataError):
            assert r.client_tracking_on(prefix=["foo", "bar", "blee"])

    @skip_if_server_version_lt("2.9.50")
    def test_client_pause(self, r):
        node = r.get_primaries()[0]
        assert r.client_pause(1, target_nodes=node)
        assert r.client_pause(timeout=1, target_nodes=node)