Skip to content

READONLY not returning an error in standalone mode broke some test case for Valkey-py. #1348

Open
@PingXie

Description

          READONLY not returning an error in standalone mode broke some test case for Valkey-py.

Reported by @mkmkme:

Yeah, the test started failing because the test was as simple as

async def test_readonly_invalid_cluster_state(self, r: valkey.Valkey):
    with pytest.raises(exceptions.ValkeyError):
        await r.readonly()

So it assumed readonly command always returns an error

I guess we should have added a check for CLIENT CAPA REDIRECT in the READONLY and READWRITE commands, to keep the old behaviour for old clients.

Originally posted by @zuiderkwast in #325 (comment)

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions