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

tests(replication): Test script replication #960

Merged
merged 2 commits into from
Mar 20, 2023

Conversation

dranikpg
Copy link
Contributor

@dranikpg dranikpg commented Mar 19, 2023

Test script replication with simple test

Fixes #885

@dranikpg dranikpg requested a review from adiholden March 19, 2023 18:43
local N = ARGV[1]

-- fill each list with its k value
for i, k in pairs(KEYS) do
Copy link
Collaborator

Choose a reason for hiding this comment

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

you are passing keys, which are pairs and actually only the second of the pair is the key?

Copy link
Contributor Author

@dranikpg dranikpg Mar 20, 2023

Choose a reason for hiding this comment

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

No, this is just the default way to iterate a table in lua, like golangs for i, v := range slice

for key_set in key_sets:
for j, k in enumerate(key_set):
l = await c_replica.lrange(k, 0, -1)
assert l == [f'{j}'.encode()] * num_ops
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe we need to call
connection.connection_pool.disconnect()

so we will not get the error log
Task pending name='Task-3' coro=<Connection.disconnect() running at /usr/local/lib/python3.8/dist-packages/aioredis/connection.py:806>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to do this in all tests, but even with it we might have those issues, lets look at it separately

@dranikpg dranikpg merged commit 6d3a191 into dragonflydb:main Mar 20, 2023
@dranikpg dranikpg deleted the script-repl branch March 22, 2023 07:04
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.

Test replication with scripts
2 participants