Skip to content
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

Merged
merged 1 commit into from
Mar 24, 2023
Merged

chore: Improve client connection checking in pytests #967

merged 1 commit into from
Mar 24, 2023

Conversation

romange
Copy link
Collaborator

@romange romange commented Mar 20, 2023

Also fix the compatibility of "client list" with redis-py client.

@romange romange requested a review from adiholden March 20, 2023 12:00
Also fix the compatibility of "client list" with redis-py client.

Signed-off-by: Roman Gershman <[email protected]>
@romange
Copy link
Collaborator Author

romange commented Mar 20, 2023 via email

@@ -281,7 +281,7 @@ def generate(max):


@pytest.mark.asyncio
Copy link
Collaborator

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?

Copy link
Collaborator Author

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why yield?

Copy link
Collaborator Author

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()
Copy link
Collaborator

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

@romange romange merged commit 52ac06e into main Mar 24, 2023
@romange romange deleted the Pr1 branch March 24, 2023 15:22
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.

2 participants