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
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion javascript/packages/orchestrator/src/networkNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@
]);
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)

Check failure on line 279 in javascript/packages/orchestrator/src/networkNode.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Replace `timedout·&&·comparator·===·"equal"·&&·desiredMetricValue·===·0·&&·value·===·undefined` with `⏎··········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...

value = 0;
else throw resp;
}
Expand Down
Loading