-
Notifications
You must be signed in to change notification settings - Fork 366
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
Log command output when the probe result doesn't match expectation #4912
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.
LGTM, just one comment.
actualResult = Connected | ||
} | ||
if expectedResult != nil && *expectedResult != actualResult { | ||
log.Infof("%s -> %s: expected %s but got %s: err - %v /// stdout - %s /// stderr - %s", podName, dstName, *expectedResult, actualResult, err, stdout, stderr) |
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.
log.Tracef
might be more suitable than log.Infof
here, also keeping consistency in this file.
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.
I think that means we can only see the log when the test itself changes the log level to Trace, which could cause flood of logs generated by the matrix?
The point of the new log is that it only logs the error when it doesn't match the expectation. So if everything works fine, there is no verbose trace logs. If one probe fails, we can find detailed outputs with this probe only.
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.
Got it, makes sense!
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, I'll let Quan decide if it's necessary to use log.Tracef
The NetworkPolicy e2e tests have been failing randomly for some time. However, it was really hard to get useful information from the "reachability" comparison. This patch logs the probe command's detailed output when the result doesn't match expectation. Signed-off-by: Quan Tian <qtian@vmware.com>
30bbb4c
to
58caf24
Compare
// log this error as trace since may be an expected failure | ||
log.Tracef("%s -> %s: error when running command: err - %v /// stdout - %s /// stderr - %s", podName, dstName, err, stdout, stderr) |
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.
removed the duplicate log in the latest patch
/skip-all |
…ntrea-io#4912) The NetworkPolicy e2e tests have been failing randomly for some time. However, it was really hard to get useful information from the "reachability" comparison. This patch logs the probe command's detailed output when the result doesn't match expectation. Signed-off-by: Quan Tian <qtian@vmware.com>
…ntrea-io#4912) The NetworkPolicy e2e tests have been failing randomly for some time. However, it was really hard to get useful information from the "reachability" comparison. This patch logs the probe command's detailed output when the result doesn't match expectation. Signed-off-by: Quan Tian <qtian@vmware.com>
The NetworkPolicy e2e tests have been failing randomly for some time. However, it was really hard to get useful information from the "reachability" comparison. This patch logs the probe command's detailed output when the result doesn't match expectation.