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(test-runner): fix logic for equals 0 desired value and timeout #1427

Merged
merged 2 commits into from
Oct 18, 2023

Conversation

pepoviola
Copy link
Collaborator

Fix #1426

cc @alexggh

@@ -276,7 +276,7 @@ export class NetworkNode implements NetworkNodeInterface {
]);
if (resp instanceof Error) {
// use `undefined` metrics values in `equal` comparisons as `0`
if (timedout && comparator === "equal" && desiredMetricValue === 0)
if (timedout && comparator === "equal" && desiredMetricValue === 0 && value === undefined)
Copy link
Contributor

Choose a reason for hiding this comment

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

I do not think that the desiredMetricValue should play any role on what its value is

Suggested change
if (timedout && comparator === "equal" && desiredMetricValue === 0 && value === undefined)
if (timedout && comparator === "equal" && value === undefined)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, the edge case is only valid when the desired value is 0 because prometheus doesn't reports some metrics until they are incremented to 1 , that was the root of this workaround.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah ok...

@pepoviola pepoviola merged commit 2aa524a into main Oct 18, 2023
21 checks passed
@pepoviola pepoviola deleted the fix/1426 branch October 18, 2023 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

is 0 and its equivalent assertions don't work as expected on metrics
4 participants