-
Notifications
You must be signed in to change notification settings - Fork 0
QDB-16746 - Flaky test test_stats_by_node #106
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
QDB-16746 - Flaky test test_stats_by_node #106
Conversation
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.
Pull Request Overview
This PR fixes a flaky test by addressing a race condition where statistics may be incomplete when queried from a fresh or purged cluster. The fix replaces exception raising with warning logging when metrics are not found in the internal index.
- Replaced
raise Exceptionwithlogger.warningandcontinuefor missing metrics in the index - Applied the fix to both
_by_uidand_cumulativefunctions
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Internal stuff we don't care about nor cannot do anything with | ||
| continue | ||
|
|
||
| if not metric in idx: |
Copilot
AI
Nov 14, 2025
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.
[nitpick] Use the Pythonic 'metric not in idx' syntax instead of 'not metric in idx' for better readability. Change to 'if metric not in idx:'.
| # Internal stuff we don't care about nor cannot do anything with | ||
| continue | ||
|
|
||
| if not metric in idx: |
Copilot
AI
Nov 14, 2025
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.
[nitpick] Use the Pythonic 'metric not in idx' syntax instead of 'not metric in idx' for better readability. Change to 'if metric not in idx:'.
| if not metric in idx: | |
| if metric not in idx: |
solatis
left a comment
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
quasardb.statsmodule expects that each statistic has three entries:But after launching a fresh cluster / purging cluster we can run into situation where we pull statistics and get only
$qdb.statistic.stat.Module expects that all three entries are present, logic of creating statistics index dictionary
depends on
.typeand.unitbeing present. Exception was raised if statistic name was present in the cluster but wasn't present in the statistics index dictionary.To fix: from now log a warning instead of raising an exception when checking if statistic name is present in the index dict.