-
Notifications
You must be signed in to change notification settings - Fork 75
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
[RFC] Test determinism for proposal.generate #1260
Conversation
retest this please |
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 am still wrapping my head around to exact comparisons, will comment on them later.
tests/unit/_modules/test_proposal.py
Outdated
# ensure that its a proposal with dedicated wal/db | ||
if disk_set.keys()[0] in replaced_hdd['Device Files']: | ||
if prop_name in ['ssd-spinner', 'nvme-ssd-spinner', 'nvme-ssd', 'nvme-spinner']: | ||
wal_db_replaced = disk_set.values()[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.
As we discussed yesterday: this overwrites wal_db_replaced
, turning it into a dict with prop_name
as the key should be better.
tests/unit/_modules/test_proposal.py
Outdated
if matching_disk_from_old_prop: | ||
assert osd_disk == matching_disk_from_old_prop[0].keys()[0] | ||
assert wal_db == matching_disk_from_old_prop[0].values()[0] | ||
return True, [], osd_disk, wal_db, wal_db_replaced |
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 return is too early, only one disk_set in old_prop[prop_name]
gets checked.
old_prop = p.create() | ||
|
||
# replace a HDD | ||
hwinfo_out_new = hwinfo_out |
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 bit misleading, hwinfo_out_new
is not a copy hwinfo_out
, just a second reference to the same list. It does not matter here because hwinfo_out
is only used for the max index when inserting the new disk at a random spot, but can be confusing.
Since only one hwinfo_out
is needed, we don't need to create a second reference. If we want to make the code easier to understand by having a second list, we can use list slicing to copy all values: hwinfo_out_new = hwinfo_out[:]
Signed-off-by: Joshua Schmid <[email protected]>
Signed-off-by: Joshua Schmid <[email protected]>
Signed-off-by: Joshua Schmid <[email protected]>
0c3db9e
to
eb18e64
Compare
Signed-off-by: Joshua Schmid <[email protected]>
Closing this PR as we moved to another way of replacing disks. Introduced #1302 |
Signed-off-by: Joshua Schmid [email protected]
Addresses #1215 ( Adding verify tests for this )
Description:
I'm not sure if that actually proves it. Please review thoroughly!
Please find more information on how to run integration tests here