-
Notifications
You must be signed in to change notification settings - Fork 6k
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
test/pybind/test_rados.py: tolerate TimedOut in test_ping_monitor #12934
Conversation
Tested: http://pulpito.ceph.com/samuelj-2017-01-14_22:21:18-rados-wip-sam-testing---basic-smithi/ failures seem unrelated |
if i pasted the backtrace of the failed test at http://tracker.ceph.com/issues/18529#note-2 |
@tchaikov's analysis is correct - we're getting a 0 return value and empty output from ping_monitor(), not a TimedOut exception - I just reproduced this with I think it's fine to work around this in the test, since ping_monitor is a pretty specialized command - just need to try again if we get an empty response rather than an exception, and same for the bash cephtool test |
Updated to fix the unit test at least Full run: http://pulpito.ceph.com/samuelj-2017-01-20_21:05:28-rados-wip-sam-testing---basic-smithi/ @jdurgin |
@@ -144,7 +144,10 @@ def test_ping_monitor(self): | |||
ret, buf, out = self.rados.mon_command(json.dumps(cmd), b'') | |||
for mon in json.loads(buf.decode('utf8'))['mons']: | |||
while True: | |||
buf = json.loads(self.rados.ping_monitor(mon['name'])) | |||
output = self.rados.ping_monitor(mon['name']) |
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.
in rados.pyx
, if the returning length is 0, None
is returned. so probably, we should instead check like:
if output:
continue
buf = json.loads(output)
or be more specific:
if output is None:
continue
buf = json.loads(output)
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.
Updated
Fixes: http://tracker.ceph.com/issues/18529 Signed-off-by: Samuel Just <sjust@redhat.com>
otherwise we could concat None with a string on connection problem. which will result in TypeError. and the caller will print misleading error like Error connecting to cluster: TypeError see also ceph#12934 Signed-off-by: Kefu Chai <kchai@redhat.com>
otherwise we could concat None with a string on connection problem. which will result in TypeError. and the caller will print misleading error like Error connecting to cluster: TypeError see also ceph#12934 Signed-off-by: Kefu Chai <kchai@redhat.com>
Fixes: http://tracker.ceph.com/issues/18529
Signed-off-by: Samuel Just sjust@redhat.com