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

test/pybind/test_rados.py: tolerate TimedOut in test_ping_monitor #12934

Merged
merged 1 commit into from Jan 26, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/test/pybind/test_rados.py
Expand Up @@ -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'])
Copy link
Contributor

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)

Copy link
Contributor Author

@athanatos athanatos Jan 26, 2017

Choose a reason for hiding this comment

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

Updated

if output is None:
continue
buf = json.loads(output)
if buf.get('health'):
break

Expand Down