-
Notifications
You must be signed in to change notification settings - Fork 128
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
Add elapsed time status updates for distributed_wait #541
base: master
Are you sure you want to change the base?
Conversation
I think this may break tests, as it would no longer match 0 second sleep for leader unit, as the sleep would be bypassed as remaining = 0 |
748a789
to
d6523c6
Compare
updated leader test to expect no waiting. |
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.
This is a nice patch which would enhance the operator's experience. Just a couple of minor observations. Thanks.
# update status every 60 seconds with wait time elapsed | ||
remaining_wait = calculated_wait | ||
elapsed = 0 | ||
while remaining_wait: |
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.
I think this would be more robust if it said:
while remaining_wait > 0:
...
I know that by inspection the code will work, it's just the defensive programmer in me!
@@ -531,7 +531,7 @@ def test_distributed_wait(self, log, modulo_distribution, sleep, | |||
is_leader.return_value = True | |||
cluster_utils.distributed_wait(modulo=9, wait=23) | |||
modulo_distribution.assert_not_called() | |||
sleep.assert_called_with(0) | |||
sleep.assert_not_called(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.
It would probably be good to check that the looping does actually work here. i.e. verify that it works for an odd number of "not divisible by" 60 seconds wait.
addresses issue #540 to provide operator feedback on elapsed time of long distributed wait times.