-
Notifications
You must be signed in to change notification settings - Fork 69
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
Python: command WAIT #1710
Python: command WAIT #1710
Conversation
307c4df
to
cea8126
Compare
Please apply my comments from #1707 here too |
9cd5a54
to
2701cce
Compare
# ensure that command doesn't time out even if timeout > request timeout (250ms by default) | ||
assert await redis_client.set(key, value2) == OK | ||
assert await redis_client.wait(100, 500) >= 0 | ||
|
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.
Should we add the following tests that also exist on the Java side?
- wrap a WAIT call with numreplicas=100 and timeout=0 in a task, ensure it raises a TimeoutError
- pass negative timeout value, ensure an error occurs
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.
added bad input test, the other test mainly checks that the command wouldnt time itself out even if the timeout is above the client request timeout, to reflect this setting from glide core, which getting a result from that line should suffice.
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.
Yeah I guess it also tests the no-timeout functionality but maybe that's not necessary really
assert await redis_client.wait(1, 1000) >= 1 | ||
else: | ||
assert await redis_client.wait(1, 1000) >= 0 |
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.
Would it be better to use == instead of >= since that's what we have in Java?
assert await redis_client.wait(1, 1000) >= 1 | |
else: | |
assert await redis_client.wait(1, 1000) >= 0 | |
assert await redis_client.wait(1, 1000) == 1 | |
else: | |
assert await redis_client.wait(1, 1000) == 0 |
# ensure that command doesn't time out even if timeout > request timeout (250ms by default) | ||
assert await redis_client.set(key, value2) == OK | ||
assert await redis_client.wait(100, 500) >= 0 | ||
|
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.
Yeah I guess it also tests the no-timeout functionality but maybe that's not necessary really
* Python: command WAIT * Python: command WAIT * changelog * doc & test changes * linter * doc update * update example * addressing commends rd2 --------- Co-authored-by: TJ Zhang <[email protected]>
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.