Project

General

Profile

Actions

Bug #63176

open

qa: make rank_asok() capable of handling errors from asok commands

Added by Dhairya Parmar 7 months ago. Updated 3 months ago.

Status:
Pending Backport
Priority:
Normal
Category:
Testing
Target version:
% Done:

0%

Source:
Development
Tags:
backport_processed
Backport:
reef,quincy
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
Labels (FS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

This came up during [0] where a new flag is required to evict client/session and testing it threw this:

2023-07-29 10:00:12,603.603 INFO:__main__:
2023-07-29 10:00:12,603.603 INFO:__main__:======================================================================
2023-07-29 10:00:12,603.603 INFO:__main__:ERROR: test_client_evict (tasks.cephfs.test_misc.TestSessionClientEvict.test_client_evict)
2023-07-29 10:00:12,603.603 INFO:__main__:----------------------------------------------------------------------
2023-07-29 10:00:12,603.603 INFO:__main__:Traceback (most recent call last):
2023-07-29 10:00:12,603.603 INFO:__main__:  File "/home/neerajpratapsingh/ceph/qa/tasks/cephfs/test_misc.py", line 554, in test_client_evict
2023-07-29 10:00:12,603.603 INFO:__main__:    self._session_client_evict(['client'])
2023-07-29 10:00:12,604.604 INFO:__main__:  File "/home/neerajpratapsingh/ceph/qa/tasks/cephfs/test_misc.py", line 538, in _session_client_evict
2023-07-29 10:00:12,604.604 INFO:__main__:    self.fs.rank_asok(cmd + ['evict'])
2023-07-29 10:00:12,604.604 INFO:__main__:  File "/home/neerajpratapsingh/ceph/qa/tasks/cephfs/filesystem.py", line 1249, in rank_asok
2023-07-29 10:00:12,604.604 INFO:__main__:    return self.json_asok(command, 'mds', info['name'], timeout=timeout)
2023-07-29 10:00:12,604.604 INFO:__main__:           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-07-29 10:00:12,604.604 INFO:__main__:  File "/home/neerajpratapsingh/ceph/qa/tasks/cephfs/filesystem.py", line 267, in json_asok
2023-07-29 10:00:12,604.604 INFO:__main__:    j = json.loads(response_data.replace('inf', 'Infinity'),
2023-07-29 10:00:12,604.604 INFO:__main__:        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-07-29 10:00:12,604.604 INFO:__main__:  File "/usr/lib64/python3.11/json/__init__.py", line 359, in loads
2023-07-29 10:00:12,604.604 INFO:__main__:    return cls(**kw).decode(s)
2023-07-29 10:00:12,604.604 INFO:__main__:           ^^^^^^^^^^^^^^^^^^^
2023-07-29 10:00:12,604.604 INFO:__main__:  File "/usr/lib64/python3.11/json/decoder.py", line 337, in decode
2023-07-29 10:00:12,604.604 INFO:__main__:    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
2023-07-29 10:00:12,605.605 INFO:__main__:               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-07-29 10:00:12,605.605 INFO:__main__:  File "/usr/lib64/python3.11/json/decoder.py", line 355, in raw_decode
2023-07-29 10:00:12,605.605 INFO:__main__:    raise JSONDecodeError("Expecting value", s, err.value) from None
2023-07-29 10:00:12,605.605 INFO:__main__:json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

This occurred because rank_asok() makes call to json_asok() which tries to deserialize str instance containing a JSON document to a Python object but fails since the response it receives from the cmd passed in test case might returns an err string and not a string with JSON schema, then it fails with the above error and so rank_asok() is basically unusable in negative tests.

This fix should be simple; catch this above exception and raise a RuntimeError with the response string received from the asok command.

[0] https://github.com/ceph/ceph/pull/49974


Related issues 2 (2 open0 closed)

Copied to CephFS - Backport #64143: quincy: qa: make rank_asok() capable of handling errors from asok commandsIn ProgressNeeraj Pratap SinghActions
Copied to CephFS - Backport #64144: reef: qa: make rank_asok() capable of handling errors from asok commandsIn ProgressNeeraj Pratap SinghActions
Actions #1

Updated by Dhairya Parmar 7 months ago

  • Category set to Testing
  • Source set to Development
Actions #2

Updated by Venky Shankar 7 months ago

  • Assignee set to Neeraj Pratap Singh
  • Backport set to reef,quincy
Actions #3

Updated by Neeraj Pratap Singh 6 months ago

  • Assignee deleted (Neeraj Pratap Singh)
  • Pull request ID set to 54208
Actions #4

Updated by Venky Shankar 6 months ago

  • Status changed from New to Triaged
  • Assignee set to Neeraj Pratap Singh
  • Target version set to v19.0.0
Actions #5

Updated by Patrick Donnelly 6 months ago

  • Status changed from Triaged to Fix Under Review
Actions #6

Updated by Neeraj Pratap Singh 3 months ago

  • Status changed from Fix Under Review to Pending Backport
Actions #7

Updated by Backport Bot 3 months ago

  • Copied to Backport #64143: quincy: qa: make rank_asok() capable of handling errors from asok commands added
Actions #8

Updated by Backport Bot 3 months ago

  • Copied to Backport #64144: reef: qa: make rank_asok() capable of handling errors from asok commands added
Actions #9

Updated by Backport Bot 3 months ago

  • Tags set to backport_processed
Actions

Also available in: Atom PDF