-
Notifications
You must be signed in to change notification settings - Fork 998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Improve client connection checking in pytests #967
Conversation
Also fix the compatibility of "client list" with redis-py client. Signed-off-by: Roman Gershman <[email protected]>
Ptal, i removed test filter
…On Mon, Mar 20, 2023, 14:21 adiholden ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In tests/dragonfly/conftest.py
<#967 (comment)>
:
> @@ -149,6 +148,7 @@ async def async_client(async_pool):
Return an async client to the default instance with all entries flushed.
"""
client = aioredis.Redis(connection_pool=async_pool)
+ await client.client_setname("test")
this fixture runs for some pytests. I dont understand why you did this
change
—
Reply to this email directly, view it on GitHub
<#967 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA4BFCDRBEZ2HK6GXLR3U2TW5BDVVANCNFSM6AAAAAAWA7OIJM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@@ -281,7 +281,7 @@ def generate(max): | |||
|
|||
|
|||
@pytest.mark.asyncio |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why you did not remove the asyncio mark here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have yet to do a proper clean-up for all the marks - just found a way to skip them
await client.flushall() | ||
return client | ||
yield client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why yield?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it does not matter here but in general, yielding is better because then you have a place to release resources if needed (after yield).
@@ -252,7 +252,7 @@ async def disconnect(replica, c_replica, crash_type): | |||
|
|||
# Check master survived all disconnects | |||
assert await c_master.ping() | |||
|
|||
await c_master.close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all the replication tests have this problem not only this one.. and I believe there is bug in the aioredis lib version we use that close does not realy close and we need to use connection_pool.disconnect
I will open PR with this change
Also fix the compatibility of "client list" with redis-py client.