mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 22:17:14 +00:00
Node e2e - Fix issue where error in scp is not return. Fixes #26435
This commit is contained in:
parent
70a71990d4
commit
d051f0b7cd
@ -162,21 +162,21 @@ func RunRemote(archive string, host string, cleanup bool, junitFileNumber int) (
|
|||||||
fmt.Sprintf("tar -xzvf ./%s", archiveName),
|
fmt.Sprintf("tar -xzvf ./%s", archiveName),
|
||||||
fmt.Sprintf("timeout -k 30s %ds ./e2e_node.test --logtostderr --v 2 --build-services=false --stop-services=%t --node-name=%s --report-dir=%s/results --junit-file-number=%d", *testTimeoutSeconds, cleanup, host, tmp, junitFileNumber),
|
fmt.Sprintf("timeout -k 30s %ds ./e2e_node.test --logtostderr --v 2 --build-services=false --stop-services=%t --node-name=%s --report-dir=%s/results --junit-file-number=%d", *testTimeoutSeconds, cleanup, host, tmp, junitFileNumber),
|
||||||
)
|
)
|
||||||
|
aggErr := []error{}
|
||||||
|
|
||||||
glog.Infof("Starting tests on %s", host)
|
glog.Infof("Starting tests on %s", host)
|
||||||
output, err := RunSshCommand("ssh", host, "--", "sh", "-c", cmd)
|
output, err := RunSshCommand("ssh", host, "--", "sh", "-c", cmd)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
aggErr = append(aggErr, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
glog.Infof("Copying test artifacts from %s", host)
|
||||||
scpErr := getTestArtifacts(host, tmp)
|
scpErr := getTestArtifacts(host, tmp)
|
||||||
|
|
||||||
// Return both the testing and scp error
|
|
||||||
if scpErr != nil {
|
if scpErr != nil {
|
||||||
return "", utilerrors.NewAggregate([]error{err, scpErr})
|
aggErr = append(aggErr, scpErr)
|
||||||
}
|
|
||||||
return "", err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
err = getTestArtifacts(host, tmp)
|
return output, utilerrors.NewAggregate(aggErr)
|
||||||
return output, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func getTestArtifacts(host, testDir string) error {
|
func getTestArtifacts(host, testDir string) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user