Skip to content

Commit

Permalink
better logging for errors e2e
Browse files Browse the repository at this point in the history
Signed-off-by: Dhruv-J <dhruvj@vmware.com>
  • Loading branch information
Dhruv-J committed Jul 17, 2023
1 parent 7d91f33 commit 3787f3e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/e2e/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -1648,7 +1648,7 @@ func (data *TestData) killProcessesAndCollectCovFiles(namespace, podName, contai
log.Infof("first find command run")
var files []string
if err != nil || rc != 0 {
log.Infof("error for first find command is not nil")
log.Infof("error for first find command is not nil: "+err.Error())
if !strings.Contains(err.Error(), "No such file or directory") {
log.Infof("reached into if condition")
return fmt.Errorf("error when running this find command (for coverage file) '%s' on Node kind-worker, stderr: <%v>, err: <%v>", cmd, stderr, err)
Expand All @@ -1662,7 +1662,7 @@ func (data *TestData) killProcessesAndCollectCovFiles(namespace, podName, contai
rc, stdout, stderr, err = data.RunCommandOnNode("kind-worker", cmd)
log.Infof("second find command run")
if err != nil || rc != 0 {
log.Infof("error for second find command is not nil")
log.Infof("error for second find command is not nil: "+err.Error())
if !strings.Contains(err.Error(), "No such file or directory") {
log.Infof("reached into if condition")
return fmt.Errorf("error when running this find command (for coverage file) '%s' on Node kind-worker, stderr: <%v>, err: <%v>", cmd, stderr, err)
Expand All @@ -1688,7 +1688,7 @@ func (data *TestData) killProcessesAndCollectCovFiles(namespace, podName, contai
rc, stdout, stderr, err = data.RunCommandOnNode("kind-worker2", cmd)
log.Infof("third find command run")
if err != nil || rc != 0 {
log.Infof("error for third find command is not nil")
log.Infof("error for third find command is not nil: "+err.Error())
if !strings.Contains(err.Error(), "No such file or directory") {
log.Infof("reached into if condition")
return fmt.Errorf("error when running this find command (for coverage file) '%s' on Node kind-worker2, stderr: <%v>, err: <%v>", cmd, stderr, err)
Expand All @@ -1702,7 +1702,7 @@ func (data *TestData) killProcessesAndCollectCovFiles(namespace, podName, contai
rc, stdout, stderr, err = data.RunCommandOnNode("kind-worker2", cmd)
log.Infof("fourth find command run")
if err != nil || rc != 0 {
log.Infof("error for fourth find command is not nil")
log.Infof("error for fourth find command is not nil: "+err.Error())
if !strings.Contains(err.Error(), "No such file or directory") {
log.Infof("reached into if condition")
return fmt.Errorf("error when running this find command (for coverage file) '%s' on Node kind-worker2, stderr: <%v>, err: <%v>", cmd, stderr, err)
Expand Down

0 comments on commit 3787f3e

Please sign in to comment.