Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Switch to run command #2022
Switch to run command #2022
Changes from 12 commits
83d57a1
ca259d3
60537bc
d81200f
e366598
afb4d49
76502a5
7e15ec6
432ee21
74a94df
44507cd
daa76c2
1568c8e
7a97849
d4fe530
e91ff88
88d1bab
9863b72
34ca320
cf9c9f0
c247e6b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
In the previous implementation, the exit_code:1 was logged as an info if there were retries available and then as an error. Now you're just logging it as a warning, not sure if you want to keep them consistent or not.
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.
Isn't this logged in L1154?
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.
Nope that's a different log line. I was comparing the previous implementation with the new one
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.
Basically this parameter for
expected_errors=[1]
in the previous implementation -The
shellutil.run
function would've logged it as an info if the exit_code was 1 but now it would be logged as an error.Not sure how big of a difference it makes, just noticed it so figured I'd point it out. I'm personally fine as is too
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.
@larohra I posted a similar comment here, not sure why it doesn't show up.
In any case, I added the 'expected_errors' parameter some time back as a stopgap to avoid logging an error when the error code is 1. This seems to be relatively common and was logged as an error due to the way the run() function is defined, and this was confusing people looking at the log. From the caller, any error code executing the command is clearly a warning.
The new implementation drops the INFO (which was there just because run logs all failures in the command it execurtes), but keeps the warning. This should be fine.
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.
Ahh ok ok, makes sense. Thanks for the clarification
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.
Good way of solving the problem! I'm sure you must've already done this, but you confirmed this has no regressions right? And DCR passed too?
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.
@kevinclark19a DCR ok?
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.
Make sure to encode the stdout/stderr before writing it to log (the run_command function always does that for you)
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.
If you dont expect this, you should add an assert that it's actually not called rather than 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.
Why did the number of calls change if we didn't change the retry number (6)?
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.
The range has always been
[1..6)
, so I'm not quite sure how this test was passing before. Any ideas?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.
Ah, ok I figured it out. Before, we were mocking
run_get_output
, because that's whatself.mount
used before. There is arun_get_output
call inmount_dvd
that we decided not to bother changing as a part of this PR (as it uses a constant string), which was the 6th call before. Since our mock is now forrun_command
, thatrun_get_output
call obviously doesn't get counted anymore, bringing the total number of calls from 6 (5run_get_output
calls inself.mount
+ 1run_get_output
inmount_dvd
itself) to 5 (just the fiverun_command
calls inself.mount
).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.
Thanks for checking! Makes sense now.