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
Automates BZ OCS podDisruptionBudget prevents successful OCP upgrades #3888
Automates BZ OCS podDisruptionBudget prevents successful OCP upgrades #3888
Conversation
6b0c0ba
to
5796080
Compare
tests/manage/z_cluster/nodes/test_simultaneous_ocs_node_drains.py
Outdated
Show resolved
Hide resolved
tests/manage/z_cluster/nodes/test_simultaneous_ocs_node_drains.py
Outdated
Show resolved
Hide resolved
tests/manage/z_cluster/nodes/test_simultaneous_ocs_node_drains.py
Outdated
Show resolved
Hide resolved
tests/manage/z_cluster/nodes/test_simultaneous_ocs_node_drains.py
Outdated
Show resolved
Hide resolved
tests/manage/z_cluster/nodes/test_simultaneous_ocs_node_drains.py
Outdated
Show resolved
Hide resolved
tests/manage/z_cluster/nodes/test_simultaneous_ocs_node_drains.py
Outdated
Show resolved
Hide resolved
tests/manage/z_cluster/nodes/test_simultaneous_ocs_node_drains.py
Outdated
Show resolved
Hide resolved
tests/manage/z_cluster/nodes/test_simultaneous_ocs_node_drains.py
Outdated
Show resolved
Hide resolved
91fcdad
to
449dbac
Compare
tests/manage/z_cluster/nodes/test_simultaneous_ocs_node_drains.py
Outdated
Show resolved
Hide resolved
tests/manage/z_cluster/upgrade/test_check_osd_mon_post_ocs_upgrade.py
Outdated
Show resolved
Hide resolved
tests/manage/z_cluster/nodes/test_simultaneous_ocs_node_drains.py
Outdated
Show resolved
Hide resolved
tests/manage/z_cluster/nodes/test_simultaneous_ocs_node_drains.py
Outdated
Show resolved
Hide resolved
tests/manage/z_cluster/upgrade/test_check_osd_mon_post_ocs_upgrade.py
Outdated
Show resolved
Hide resolved
tests/manage/z_cluster/nodes/test_simultaneous_ocs_node_drains.py
Outdated
Show resolved
Hide resolved
tests/manage/z_cluster/upgrade/test_check_osd_post_ocs_upgrade.py
Outdated
Show resolved
Hide resolved
tests/manage/z_cluster/upgrade/test_check_osd_post_ocs_upgrade.py
Outdated
Show resolved
Hide resolved
34ddf4c
to
8cdf37a
Compare
8cdf37a
to
91db156
Compare
|
||
log = logging.getLogger(__name__) | ||
|
||
|
||
@post_ocs_upgrade | ||
@skipif_external_mode | ||
@pytest.mark.polarion_id("OCS-2449") | ||
class TestToCheckMonPDBPostUpgrade(ManageTest): |
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.
Now the test file "test_check_mon_pdb_post_upgrade.py" consists of both mon and osd pdb test functions. Please also change the test file name accordingly or make it generic something like test_pdb_check_post_upgrade.py
Same for the class function also.
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.
DOne
2. Rook-ceph-drain-canary pods disappeared after upgrade of OCS version to ocs-operator.v4.6.2-233.ci | ||
|
||
""" | ||
assert ( |
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 also consider checking values for disruptions_allowed, min_available_osd, max_unavailable_osd, the way how we are checking for test_check_mon_pdb_post_upgrade?
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 validations in validate_existence_of_blocking_pdb(), Please check
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.
PR validation on existing cluster
Cluster Name: tdesala-a11
Cluster Configuration:
PR Test Suite: tier4b
PR Test Path: tests/manage/z_cluster/nodes/test_nodes_maintenance.py::TestNodesMaintenance::test_simultaneous_node_drains
Additional Test Params:
OCP VERSION: 4.8
OCS VERSION: 4.8
Job FAILED (installation failed, tests not executed).
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.
PR validation on existing cluster
Cluster Name: tdesala-a11
Cluster Configuration:
PR Test Suite: tier4b
PR Test Path: tests/manage/z_cluster/nodes/test_nodes_maintenance.py::TestNodesMaintenance::test_simultaneous_node_drains
Additional Test Params:
OCP VERSION: 4.8
OCS VERSION: 4.8
Job FAILED (installation failed, tests not executed).
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.
LGTM
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.
PR validation on existing cluster
Cluster Name: tdesala-a11
Cluster Configuration:
PR Test Suite: tier4b
PR Test Path: tests/manage/z_cluster/nodes/test_nodes_maintenance.py::TestNodesMaintenance::test_pdb_check_simultaneous_node_drains
Additional Test Params:
OCP VERSION: 4.8
OCS VERSION: 4.8
Job FAILED (installation failed, tests not executed).
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.
PR validation on existing cluster
Cluster Name: tdesala-a11
Cluster Configuration:
PR Test Suite:
PR Test Path: tests/manage/z_cluster/nodes/test_nodes_maintenance.py::TestNodesMaintenance::test_pdb_check_simultaneous_node_drains
Additional Test Params:
OCP VERSION: 4.8
OCS VERSION: 4.8
Job UNSTABLE (some or all tests failed).
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.
PR validation on existing cluster
Cluster Name: tdesala-a11
Cluster Configuration:
PR Test Suite:
PR Test Path: tests/manage/z_cluster/nodes/test_nodes_maintenance.py::TestNodesMaintenance::test_pdb_check_simultaneous_node_drains
Additional Test Params:
OCP VERSION: 4.8
OCS VERSION: 4.8
Job UNSTABLE (some or all tests failed).
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.
PR validation on existing cluster
Cluster Name: tdesala-a11
Cluster Configuration:
PR Test Suite:
PR Test Path: tests/manage/z_cluster/nodes/test_nodes_maintenance.py::TestNodesMaintenance::test_pdb_check_simultaneous_node_drains
Additional Test Params:
OCP VERSION: 4.8
OCS VERSION: 4.8
Job UNSTABLE (some or all tests failed).
Signed-off-by: Shrivaibavi Raghaventhiran <sraghave@redhat.com>
b955224
to
f77b514
Compare
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.
PR validation on existing cluster
Cluster Name: tdesala-a11
Cluster Configuration:
PR Test Suite:
PR Test Path: tests/manage/z_cluster/nodes/test_nodes_maintenance.py::TestNodesMaintenance::test_pdb_check_simultaneous_node_drains
Additional Test Params:
OCP VERSION: 4.8
OCS VERSION: 4.8
Signed-off-by: Shrivaibavi Raghaventhiran <sraghave@redhat.com>
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.
LGTM
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.
Just one note, but it is not a blocker for this PR.
allowed_disruptions = osd_pdb[osd].get("status").get("disruptionsAllowed") | ||
maximum_unavailable = osd_pdb[osd].get("spec").get("maxUnavailable") |
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.
Not sure if it might happen, but if status
or spec
key will not be available, it will raise exception AttributeError: 'NoneType' object has no attribute 'get'
.
If it is a valid scenario (that those keys might not be present) and we want to get some default value (None
in this case), it is better to provide empty dict ({}
) as default value for the get(...)
method:
allowed_disruptions = osd_pdb[osd].get("status").get("disruptionsAllowed") | |
maximum_unavailable = osd_pdb[osd].get("spec").get("maxUnavailable") | |
allowed_disruptions = osd_pdb[osd].get("status", {}).get("disruptionsAllowed") | |
maximum_unavailable = osd_pdb[osd].get("spec", {}).get("maxUnavailable") |
Or if this keys status
and spec
should be always present, you might use this way:
allowed_disruptions = osd_pdb[osd].get("status").get("disruptionsAllowed") | |
maximum_unavailable = osd_pdb[osd].get("spec").get("maxUnavailable") | |
allowed_disruptions = osd_pdb[osd]["status"].get("disruptionsAllowed") | |
maximum_unavailable = osd_pdb[osd]["spec"].get("maxUnavailable") |
And if it will for some reason happen, that status
or spec
key are not present, it will raise KeyError: 'status'
exception, which might be slightly more clear, than the AttributeError: 'NoneType' object has no attribute 'get'
exception mentioned above.
for pdb in pdb_obj_get.get("items"): | ||
if not any( | ||
osd in pdb["metadata"]["name"] | ||
for osd in [constants.MDS_PDB, constants.MON_PDB] |
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 have osd pdb as well
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.
We get only OSD PDBs from the list of PDBs so we exclude mons and mds PDBs
Automates BZ https://bugzilla.redhat.com/show_bug.cgi?id=1861104
Signed-off-by: Shrivaibavi Raghaventhiran sraghave@redhat.com