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

fix(stats.py): Correctly collect worst-case status for tests #517

Merged

Conversation

k0machi
Copy link
Collaborator

@k0machi k0machi commented Nov 20, 2024

This commit fixes an issue where worst case collection function would
never take the branch to compare statuses, leading to last status always
being chosen - for 3 runs of (failed, pass, pass) the outcome would be
pass and for (failed, pass, failed) it would be failed. This commit
corrects this and now statuses are properly evaluated.

Fixes #488

This commit fixes an issue where worst case collection function would
never take the branch to compare statuses, leading to last status always
being chosen - for 3 runs of (failed, pass, pass) the outcome would be
pass and for (failed, pass, failed) it would be failed. This commit
corrects this and now statuses are properly evaluated.

Fixes scylladb#488
@k0machi k0machi self-assigned this Nov 20, 2024
@k0machi k0machi requested review from fruch, soyacz and roydahan November 20, 2024 19:28
@k0machi
Copy link
Collaborator Author

k0machi commented Nov 20, 2024

Before:

image

After:

image

if cmp_class(container_class(status)) < cmp_class(container_class(run[field_name])):
status_map[run_number] = run[field_name]
case (str(), dict()):
last_status, _ = status
Copy link
Contributor

Choose a reason for hiding this comment

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

has the content of status_map changed ? or this logic was never correct ?

I would recommend writing a unittest to guard this one

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I changed the logic at some point to support investigation statuses, but never updated the comparer matcher, so yes, it was never correct after that change, just happened to work sometimes.

@k0machi k0machi merged commit 3b0a3ca into scylladb:master Nov 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants